Commit a3b92ac3 authored by JC Brand's avatar JC Brand

Call destroy on rejected contact

Rather than calling remove and triggering a custom event
parent 567cfd35
......@@ -1185,10 +1185,9 @@
},
declineRequest: function (ev) {
var that = this;
xmppchat.connection.roster.unauthorize(this.model.get('jid'));
that.trigger('decline-request', that.model);
ev.preventDefault();
xmppchat.connection.roster.unauthorize(this.model.get('jid'));
this.model.destroy();
},
template: _.template(
......@@ -1515,11 +1514,6 @@
this.model.on("add", function (item) {
var view = new xmppchat.RosterItemView({model: item});
this.rosteritemviews[item.id] = view;
if (item.get('ask') === 'request') {
view.on('decline-request', function (item) {
this.model.remove(item.id);
}, this);
}
this.render(item);
}, this);
......@@ -1531,12 +1525,6 @@
this.render(item);
}, this);
this.model.on("remove", function (item) {
this.removeRosterItem(item);
}, this);
// XXX: Not completely sure if this is needed ('remove' might be
// enough).
this.model.on("destroy", function (item) {
this.removeRosterItem(item);
}, this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment