Browse code

FIX: prijimanie spravy od kontakut, ktory nie je v rosteri

Cinan Rakosnik authored on 12/05/2013 at 13:17:42
Showing 1 changed files
... ...
@@ -216,22 +216,21 @@ this.App =
216 216
         else
217 217
           #TODO: prepisat tuto hrozu
218 218
 
219
-
220 219
           contact = App.Collections.contacts.findByJid(App.stripJid(result.from))
221
-          contact.setPreferredResource(result.from)
222 220
 
223 221
           if contact
224 222
             contactView = App.Collections.contacts.friendsList.hasContact(contact) ||
225 223
               App.Collections.contacts.activeList.hasContact(contact)
226 224
           else
227 225
             contact = new Xmpp.Models.Contact(
228
-              id: result.from
229
-              jid: result.from
226
+              id: App.stripJid(result.from)
227
+              jid: App.stripJid(result.from)
230 228
               belongsTo: [result.to]
231 229
             )
232 230
             App.Collections.contacts.add(contact, merge: true)
233 231
             contactView = App.Collections.contacts.friendsList.hasContact(contact)
234 232
 
233
+          contact.setPreferredResource(result.from)
235 234
           contactView.startChat()
236 235
 
237 236
           tab = _.find(App.Views.tabbar.tabs, (tab) ->