Fixes #645. When accepting a contact request...

the contact didn't appear under the pending contacts list.
This commit is contained in:
JC Brand 2016-07-28 10:35:43 +00:00
parent a1e24c95c9
commit e28aba5a59
2 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,8 @@
use it. [jcbrand] use it. [jcbrand]
- Mention someone in your chat room message by clicking on their name in the occupants - Mention someone in your chat room message by clicking on their name in the occupants
list. [jcbrand] list. [jcbrand]
- #645 When accepting a contact request, the contact didn't appear in the
pending contacts group. [jcbrand]
## 1.0.4 (2016-07-26) ## 1.0.4 (2016-07-26)

View File

@ -883,7 +883,15 @@
onContactRequestChange: function (contact) { onContactRequestChange: function (contact) {
if ((this.model.get('name') === HEADER_REQUESTING_CONTACTS) && !contact.get('requesting')) { if ((this.model.get('name') === HEADER_REQUESTING_CONTACTS) && !contact.get('requesting')) {
this.model.contacts.remove(contact.get('id')); /* We suppress events, otherwise the remove event will
* also cause the contact's view to be removed from the
* "Pending Contacts" group.
*/
this.model.contacts.remove(contact.get('id'), {'silent': true});
// Since we suppress events, we make sure the view and
// contact are removed from this group.
this.get(contact.get('id')).remove();
this.onRemove(contact);
} }
}, },