Commit 58bbbe8b authored by ichim-david's avatar ichim-david

Cached message from attribute of messageReceived method

parent e635fb4f
...@@ -1151,8 +1151,9 @@ ...@@ -1151,8 +1151,9 @@
}, },
messageReceived: function (message) { messageReceived: function (message) {
var partner_jid, $message = $(message); var partner_jid, $message = $(message),
if ($message.attr('from') == xmppchat.connection.jid) { message_from = $message.attr('from');
if ( message_from == xmppchat.connection.jid) {
// FIXME: Forwarded messages should be sent to specific resources, not broadcasted // FIXME: Forwarded messages should be sent to specific resources, not broadcasted
return true; return true;
} }
...@@ -1161,7 +1162,7 @@ ...@@ -1161,7 +1162,7 @@
$message = $forwarded.children('message'); $message = $forwarded.children('message');
} }
var from = Strophe.getBareJidFromJid($message.attr('from')), var from = Strophe.getBareJidFromJid(message_from),
to = Strophe.getBareJidFromJid($message.attr('to')), to = Strophe.getBareJidFromJid($message.attr('to')),
view, resource; view, resource;
...@@ -1171,7 +1172,7 @@ ...@@ -1171,7 +1172,7 @@
resource = Strophe.getResourceFromJid($message.attr('to')); resource = Strophe.getResourceFromJid($message.attr('to'));
} else { } else {
partner_jid = from; partner_jid = from;
resource = Strophe.getResourceFromJid($message.attr('from')); resource = Strophe.getResourceFromJid(message_from);
} }
view = this.views[partner_jid]; view = this.views[partner_jid];
......
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