diff options
author | Marvin W <git@larma.de> | 2019-09-10 21:01:03 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2019-09-10 21:11:49 +0200 |
commit | e84f2c49567e86d2a261ea264d65c4adc549c930 (patch) | |
tree | 31e8f91c473eb30601acf2a28409b103644ab774 /xmpp-vala/src/module | |
parent | bd7fde99af3df59c5ec96184b2649b4308250b24 (diff) | |
download | dino-e84f2c49567e86d2a261ea264d65c4adc549c930.tar.gz dino-e84f2c49567e86d2a261ea264d65c4adc549c930.zip |
Fix check of source of a carbons message
Diffstat (limited to 'xmpp-vala/src/module')
-rw-r--r-- | xmpp-vala/src/module/xep/0280_message_carbons.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xmpp-vala/src/module/xep/0280_message_carbons.vala b/xmpp-vala/src/module/xep/0280_message_carbons.vala index fca35606..508d3322 100644 --- a/xmpp-vala/src/module/xep/0280_message_carbons.vala +++ b/xmpp-vala/src/module/xep/0280_message_carbons.vala @@ -52,9 +52,9 @@ public class ReceivedPipelineListener : StanzaListener<MessageStanza> { StanzaNode? forwarded_node = carbons_node.get_subnode("forwarded", "urn:xmpp:forward:0"); if (forwarded_node != null) { StanzaNode? message_node = forwarded_node.get_subnode("message", Xmpp.NS_URI); - string? from_attribute = message_node.get_attribute("from", Xmpp.NS_URI); // Any forwarded copies received by a Carbons-enabled client MUST be from that user's bare JID; any copies that do not meet this requirement MUST be ignored. - if (from_attribute != null && from_attribute == stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid.to_string()) { + if (!message.from.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) { + warning("Received alleged carbon message from %s, ignoring", message.from.to_string()); return true; } if (received_node != null) { |