|
@@ -1081,10 +1081,16 @@
|
|
}
|
|
}
|
|
_.each(open_chats, $.proxy(function (jid) {
|
|
_.each(open_chats, $.proxy(function (jid) {
|
|
if (jid != 'controlbox') {
|
|
if (jid != 'controlbox') {
|
|
- if (strinclude(jid, xmppchat.connection.muc_domain)) {
|
|
|
|
- this.createChatBox(jid);
|
|
|
|
|
|
+ if (this.isChatRoom(jid)) {
|
|
|
|
+ this.createChatRoom(jid);
|
|
} else {
|
|
} else {
|
|
- this.openChat(jid);
|
|
|
|
|
|
+ xmppchat.connection.vcard.get($.proxy(function (iq) {
|
|
|
|
+ $vcard = $(iq).find('vCard');
|
|
|
|
+ var fullname = $vcard.find('BINVAL').text();
|
|
|
|
+ var img = $vcard.find('BINVAL').text();
|
|
|
|
+ var img_type = $vcard.find('TYPE').text();
|
|
|
|
+ this.openRestoredChat(jid, fullname, img, img_type);
|
|
|
|
+ }, this), jid);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}, this));
|
|
}, this));
|
|
@@ -1105,12 +1111,11 @@
|
|
return view;
|
|
return view;
|
|
},
|
|
},
|
|
|
|
|
|
- createChatBox: function (roster_item) {
|
|
|
|
- var jid = roster_item.get('jid');
|
|
|
|
|
|
+ createChatBox: function (jid, fullname) {
|
|
var box = new xmppchat.ChatBox({
|
|
var box = new xmppchat.ChatBox({
|
|
'id': jid,
|
|
'id': jid,
|
|
'jid': jid,
|
|
'jid': jid,
|
|
- 'fullname': roster_item.get('fullname'),
|
|
|
|
|
|
+ 'fullname': fullname,
|
|
'portrait_url': '',
|
|
'portrait_url': '',
|
|
'user_profile_url': '',
|
|
'user_profile_url': '',
|
|
});
|
|
});
|
|
@@ -1128,15 +1133,19 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ openRestoredChat: function (bare_jid, fullname, img, img_type) {
|
|
|
|
+ this.createChatBox(jid, fullname)
|
|
|
|
+ },
|
|
|
|
+
|
|
openChat: function (roster_item) {
|
|
openChat: function (roster_item) {
|
|
- var view, jid = roster_item.get('jid');
|
|
|
|
|
|
+ var jid = roster_item.get('jid');
|
|
jid = Strophe.getBareJidFromJid(jid);
|
|
jid = Strophe.getBareJidFromJid(jid);
|
|
if (this.model.get(jid)) {
|
|
if (this.model.get(jid)) {
|
|
this.showChat(jid);
|
|
this.showChat(jid);
|
|
} else if (this.isChatRoom(jid)) {
|
|
} else if (this.isChatRoom(jid)) {
|
|
- view = this.createChatRoom(jid);
|
|
|
|
|
|
+ this.createChatRoom(jid);
|
|
} else {
|
|
} else {
|
|
- view = this.createChatBox(roster_item);
|
|
|
|
|
|
+ this.createChatBox(jid, roster_item.get('fullname'));
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1435,9 +1444,6 @@
|
|
this.add(model);
|
|
this.add(model);
|
|
},
|
|
},
|
|
|
|
|
|
- getRosterItem: function (jid) {
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
addResource: function (bare_jid, resource) {
|
|
addResource: function (bare_jid, resource) {
|
|
var item = this.getItem(bare_jid),
|
|
var item = this.getItem(bare_jid),
|
|
resources;
|
|
resources;
|