# HG changeset patch # User Mikael Berthe # Date 1354026386 -3600 # Node ID c00b919cf4aceaa2f4c7c3875cb38d0e08288474 # Parent 8c51c684dd2f9027049cd9e64e708d406ecb79d2 Hopefully fix #94 (OTR leak when block_unsubscribed is set) diff -r 8c51c684dd2f -r c00b919cf4ac 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;