1
0
Fork 0

Add carbons from check

This commit is contained in:
James Booth 2017-01-23 22:25:36 +00:00
parent c073418306
commit 8e75437a7e
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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'>"