Skip to content

Commit e84f2c4

Browse files
committed
Fix check of source of a carbons message
1 parent bd7fde9 commit e84f2c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: xmpp-vala/src/module/xep/0280_message_carbons.vala

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public class ReceivedPipelineListener : StanzaListener<MessageStanza> {
5252
StanzaNode? forwarded_node = carbons_node.get_subnode("forwarded", "urn:xmpp:forward:0");
5353
if (forwarded_node != null) {
5454
StanzaNode? message_node = forwarded_node.get_subnode("message", Xmpp.NS_URI);
55-
string? from_attribute = message_node.get_attribute("from", Xmpp.NS_URI);
5655
// 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.
57-
if (from_attribute != null && from_attribute == stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid.to_string()) {
56+
if (!message.from.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) {
57+
warning("Received alleged carbon message from %s, ignoring", message.from.to_string());
5858
return true;
5959
}
6060
if (received_node != null) {

0 commit comments

Comments
 (0)