Commit 764a7101 authored by ichim-david's avatar ichim-david

Cached presence for onChatRoomPresence and removed length comparision to > 0

parent 300b069a
...@@ -963,12 +963,13 @@ ...@@ -963,12 +963,13 @@
onChatRoomPresence: function (presence, room) { onChatRoomPresence: function (presence, room) {
// TODO see if nick is useful // TODO see if nick is useful
var nick = room.nick, var nick = room.nick,
from = $(presence).attr('from'); $presence = $(presence),
if ($(presence).attr('type') !== 'error') { from = $presence.attr('from');
if ($presence.attr('type') !== 'error') {
// check for status 110 to see if it's our own presence // check for status 110 to see if it's our own presence
if ($(presence).find("status[code='110']").length > 0) { if ($presence.find("status[code='110']").length) {
// check if server changed our nick // check if server changed our nick
if ($(presence).find("status[code='210']").length > 0) { if ($presence.find("status[code='210']").length) {
this.model.set({'nick': Strophe.getResourceFromJid(from)}); this.model.set({'nick': Strophe.getResourceFromJid(from)});
} }
} }
......
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