diff options
author | James Booth <boothj5@gmail.com> | 2017-01-23 22:25:36 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2017-01-23 22:25:36 +0000 |
commit | 8e75437a7e43d4c55e861691f74892e666e29b0b (patch) | |
tree | dc87643931f73f66e7b413ee9e93d9d797517369 /src/xmpp/message.c | |
parent | c07341830670819b4dc4a16c56fcac9ad21be16d (diff) | |
download | profani-tty-8e75437a7e43d4c55e861691f74892e666e29b0b.tar.gz |
Add carbons from check
Diffstat (limited to 'src/xmpp/message.c')
-rw-r--r-- | src/xmpp/message.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 9d80fb1f..3f8ad5a0 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -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; |