mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Add carbons from check
This commit is contained in:
parent
c073418306
commit
8e75437a7e
@ -714,6 +714,14 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Jid *my_jid = jid_create(connection_get_fulljid());
|
||||
const char *const stanza_from = xmpp_stanza_get_from(stanza);
|
||||
Jid *msg_jid = jid_create(stanza_from);
|
||||
if (g_strcmp0(my_jid->barejid, msg_jid->barejid) != 0) {
|
||||
log_warning("Invalid carbon received, from: %s", stanza_from);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const gchar *to = xmpp_stanza_get_to(message);
|
||||
const gchar *from = xmpp_stanza_get_from(message);
|
||||
|
||||
@ -722,7 +730,6 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
||||
|
||||
Jid *jid_from = jid_create(from);
|
||||
Jid *jid_to = jid_create(to);
|
||||
Jid *my_jid = jid_create(connection_get_fulljid());
|
||||
|
||||
// check for pgp encrypted message
|
||||
char *enc_message = NULL;
|
||||
|
@ -70,7 +70,7 @@ receive_carbon(void **state)
|
||||
assert_true(prof_output_exact("unencrypted"));
|
||||
|
||||
stbbr_send(
|
||||
"<message type='chat' to='stabber@localhost/profanity' from='buddy1@localhost'>"
|
||||
"<message type='chat' to='stabber@localhost/profanity' from='stabber@localhost'>"
|
||||
"<received xmlns='urn:xmpp:carbons:2'>"
|
||||
"<forwarded xmlns='urn:xmpp:forward:0'>"
|
||||
"<message id='prof_msg_7' xmlns='jabber:client' type='chat' lang='en' to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>"
|
||||
|
Loading…
Reference in New Issue
Block a user