Browse code

Zobrazovanie noveho chatu ownerovi aj ostatnemu cloveku

Cinan Rakosnik authored on 28/04/2013 at 15:39:44
Showing 2 changed files
... ...
@@ -34,6 +34,9 @@ class Xmpp.Models.Chat extends Xmpp.Models.Model
34 34
       jid != App.Models.me.get('jid')
35 35
     )
36 36
 
37
+    if (owner != App.Models.me.get('jid'))
38
+      contactsWithoutMe = contactsWithoutMe.concat([owner]);
39
+
37 40
     attendants = _.map(contactsWithoutMe, (jid) =>
38 41
       contact = App.Collections.contacts.findByJid(jid)
39 42
       if not contact
... ...
@@ -60,8 +60,13 @@ class Xmpp.Collections.ContactsCollection extends Backbone.Collection
60 60
     else
61 61
       @add(contact)
62 62
 
63
-  moveToActiveList: (contact) ->
64
-    @_switchContactBelongingList(@get(contact), @friendsList, @activeList) && @activeList.reOrder()
63
+  moveToActiveList: (contacts) ->
64
+    App.debug ['move to active list', contacts];
65
+    contacts = [contacts] unless _.isArray(contacts)
66
+
67
+    _.each(contacts, (contact) =>
68
+      @_switchContactBelongingList(@get(contact), @friendsList, @activeList) && @activeList.reOrder()
69
+    )
65 70
 
66 71
   moveToInactiveList: (contact) ->
67 72
     if contact == 'all'