about summary refs log tree commit diff stats
path: root/src/otr
diff options
context:
space:
mode:
Diffstat (limited to 'src/otr')
-rw-r--r--src/otr/otrlibv3.c5
-rw-r--r--src/otr/otrlibv4.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/otr/otrlibv3.c b/src/otr/otrlibv3.c
index 9bab4eed..fa574bfc 100644
--- a/src/otr/otrlibv3.c
+++ b/src/otr/otrlibv3.c
@@ -140,7 +140,10 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
         if (nextMsg != OTRL_SMP_EXPECT1) {
             otrl_message_abort_smp(user_state, ops, NULL, context);
         } else {
-            ui_smp_recipient_initiated(context->username);
+            ProfChatWin *chatwin = wins_get_chat(context->username);
+            if (chatwin) {
+                ui_smp_recipient_initiated(chatwin);
+            }
             g_hash_table_insert(smp_initiators, strdup(context->username), strdup(context->username));
         }
     }
diff --git a/src/otr/otrlibv4.c b/src/otr/otrlibv4.c
index 8ed17fcf..1f2c4057 100644
--- a/src/otr/otrlibv4.c
+++ b/src/otr/otrlibv4.c
@@ -37,6 +37,7 @@
 #include <libotr/message.h>
 
 #include "ui/ui.h"
+#include "window_list.h"
 #include "log.h"
 #include "otr/otr.h"
 #include "otr/otrlib.h"
@@ -176,10 +177,14 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
     OtrlMessageAppOps *ops = otr_messageops();
     GHashTable *smp_initiators = otr_smpinitators();
 
+    ProfChatWin *chatwin = wins_get_chat(context->username);
+
     switch(smp_event)
     {
         case OTRL_SMPEVENT_ASK_FOR_SECRET:
-            ui_smp_recipient_initiated(context->username);
+            if (chatwin) {
+                ui_smp_recipient_initiated(chatwin);
+            }
             g_hash_table_insert(smp_initiators, strdup(context->username), strdup(context->username));
             break;