Hopefully fix #94 (OTR leak when block_unsubscribed is set)
authorMikael Berthe <mikael@lilotux.net>
Tue, 27 Nov 2012 15:26:26 +0100
changeset 2044 c00b919cf4ac
parent 2043 8c51c684dd2f
child 2045 7f06eb956734
child 2046 27cbd1b7ec2a
Hopefully fix #94 (OTR leak when block_unsubscribed is set)
mcabber/mcabber/xmpp.c
--- a/mcabber/mcabber/xmpp.c	Tue Nov 27 10:33:08 2012 +0100
+++ b/mcabber/mcabber/xmpp.c	Tue Nov 27 15:26:26 2012 +0100
@@ -1104,17 +1104,6 @@
     check_signature(bjid, rname, node_signed, decrypted_pgp);
 #endif
 
-#ifdef HAVE_LIBOTR
-  if (otr_enabled()) {
-    decrypted_otr = (char*)body;
-    otr_msg = otr_receive(&decrypted_otr, bjid, &free_msg);
-    if (!decrypted_otr) {
-      goto gotmessage_return;
-    }
-    body = decrypted_otr;
-  }
-#endif
-
   // Check for unexpected groupchat messages
   // If we receive a groupchat message from a room we're not a member of,
   // this is probably a server issue and the best we can do is to send
@@ -1163,6 +1152,17 @@
     g_free(sbjid);
   }
 
+#ifdef HAVE_LIBOTR
+  if (otr_enabled()) {
+    decrypted_otr = (char*)body;
+    otr_msg = otr_receive(&decrypted_otr, bjid, &free_msg);
+    if (!decrypted_otr) {
+      goto gotmessage_return;
+    }
+    body = decrypted_otr;
+  }
+#endif
+
   { // format and pass message for further processing
     gchar *fullbody = NULL;
     guint encrypted;