Commit adb4f62e authored by JC Brand's avatar JC Brand

Fixes #790 mam retrieval broken

parent 2c8b31c1
......@@ -58,7 +58,7 @@
- #694 The `notification_option` wasn't being used consistently. [jcbrand]
- #745 New config option [priority](https://conversejs.org/docs/html/configuration.html#priority) [jcbrand]
- #770 Allow setting contact attrs on chats.open [Ape]
- #790 MAM retrieval broken [jcbrand]
## 2.0.6 (2017-02-13)
- Escape user-generated input to prevent JS-injection attacks. (Thanks to SamWhited) [jcbrand]
......
......@@ -1476,7 +1476,8 @@
chatbox, resource,
from_jid = message.getAttribute('from'),
to_jid = message.getAttribute('to'),
to_resource = Strophe.getResourceFromJid(to_jid);
to_resource = Strophe.getResourceFromJid(to_jid),
is_carbon = !_.isNull(message.querySelector('received[xmlns="'+Strophe.NS.CARBONS+'"]'));
if (_converse.filter_by_resource && (to_resource && to_resource !== _converse.resource)) {
_converse.log(
......@@ -1498,7 +1499,7 @@
if (!_.isNull(forwarded)) {
var forwarded_message = forwarded.querySelector('message');
var forwarded_from = forwarded_message.getAttribute('from');
if (Strophe.getBareJidFromJid(forwarded_from) !== from_jid) {
if (is_carbon && Strophe.getBareJidFromJid(forwarded_from) !== from_jid) {
// Prevent message forging via carbons
//
// https://xmpp.org/extensions/xep-0280.html#security
......
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