1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

OMEMO: Don't encrypt to yourself (MUC)

Use connection_get_barejid instead of connection_get_fulljid.
This commit is contained in:
DebXWoody 2021-05-29 07:30:36 +02:00
parent 3b020144d5
commit 64bcc06259
No known key found for this signature in database
GPG Key ID: CBD1B596579B7FFF

View File

@ -794,15 +794,15 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_
// Don't encrypt for this device (according to // Don't encrypt for this device (according to
// <https://xmpp.org/extensions/xep-0384.html#encrypt>). // <https://xmpp.org/extensions/xep-0384.html#encrypt>).
// Yourself as recipients in case of MUC // Yourself as recipients in case of MUC
Jid* me = jid_create(connection_get_fulljid()); char* mybarejid = connection_get_barejid();
if ( !g_strcmp0(me->barejid, recipients_iter->data) ) { if ( !g_strcmp0(mybarejid, recipients_iter->data) ) {
if (GPOINTER_TO_INT(device_ids_iter->data) == omemo_ctx.device_id) { if (GPOINTER_TO_INT(device_ids_iter->data) == omemo_ctx.device_id) {
jid_destroy(me); free(mybarejid);
log_debug("[OMEMO][SEND] Skipping %d (my device) ", GPOINTER_TO_INT(device_ids_iter->data)); log_debug("[OMEMO][SEND] Skipping %d (my device) ", GPOINTER_TO_INT(device_ids_iter->data));
continue; continue;
} }
} }
jid_destroy(me); free(mybarejid);
log_debug("[OMEMO][SEND] recipients with device id %d for %s", GPOINTER_TO_INT(device_ids_iter->data), recipients_iter->data); log_debug("[OMEMO][SEND] recipients with device id %d for %s", GPOINTER_TO_INT(device_ids_iter->data), recipients_iter->data);
res = session_cipher_create(&cipher, omemo_ctx.store, &address, omemo_ctx.signal); res = session_cipher_create(&cipher, omemo_ctx.store, &address, omemo_ctx.signal);