about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/omemo/omemo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c
index 192d3d2a..9b2b35f5 100644
--- a/src/omemo/omemo.c
+++ b/src/omemo/omemo.c
@@ -791,6 +791,19 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_
                 .device_id = GPOINTER_TO_INT(device_ids_iter->data)
             };
 
+            // Don't encrypt for this device (according to
+            // <https://xmpp.org/extensions/xep-0384.html#encrypt>).
+            // Yourself as recipients in case of MUC
+            char* mybarejid = connection_get_barejid();
+            if ( !g_strcmp0(mybarejid, recipients_iter->data) ) {
+                if (GPOINTER_TO_INT(device_ids_iter->data) == omemo_ctx.device_id) {
+                    free(mybarejid);
+                    log_debug("[OMEMO][SEND] Skipping %d (my device) ", GPOINTER_TO_INT(device_ids_iter->data));
+                    continue;
+                }
+            }
+            free(mybarejid);
+
             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);
             if (res != SG_SUCCESS ) {
class='alt'>
ddf378d4 ^
5ccf2653 ^

2c678a4e ^
















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49