This was sent to [EMAIL PROTECTED] ---------- Forwarded Message ----------
Subject: [Licq-devel] Patch for OTR encryption - Problem with Miranda Date: Tuesday 17 October 2006 16:38 From: Hagen Meyer <[EMAIL PROTECTED]> To: [email protected] Hi, I tried the OTR-patch by Martin Garbe, and it worked for me with a Gaim counterpart. But it didn't work with Miranda (Licq showed the OTR-System-Messages just as normal messages, which was really annoying). I found out it was because of a different message-format (?) called mFormat in icqd-srv.cpp. So I just copy-pasted the relevant OTR-Code. Now it works with Miranda, but it has only been tested for a few minutes.. I included the patch here, but the original OTR patch still has to be applied!! regards, Hagen ------------------------------------------------------- -- This signature intentionally says nothing. Erik Johansson http://ejohansson.se
--- icqd-srv.cpp.orig 2006-08-19 08:04:38.000000000 +0200
+++ icqd-srv.cpp 2006-10-17 14:53:09.000000000 +0200
@@ -3251,6 +3282,34 @@
char *szMsg = parseRTF(szTmpMsg);
delete [] szTmpMsg;
+ unsigned long nflags = 0;
+
+#ifdef HAVE_LIBOTR
+ char *szNewMsg = NULL;
+ int ret = gOTRHelper.Decrypt(szId, LICQ_PPID, szMsg, &szNewMsg);
+ if (ret == 1)
+ {
+ //internal message. don't show to user.
+ break;
+ }
+ if (szNewMsg != NULL)
+ {
+ if (gOTRHelper.IsOtrTaggedMsg(szMsg))
+ {
+ gLog.Info("%sUntag OTR tagged message.\n", L_SRVxSTR);
+ }
+ else
+ {
+ gLog.Info("%sReplace original message with decrypted.\n", L_SRVxSTR);
+ nflags |= E_ENCRYPTED;
+ }
+ delete [] szMsg;
+ szMsg = new char[strlen(szNewMsg)+1];
+ strcpy(szMsg, szNewMsg);
+ gOTRHelper.FreeNewMessage(&szNewMsg);
+ }
+#endif
+
// Seems to be misplaced, don't do it here
//gTranslator.ServerToClient(szMsg);
pgptePEX8KlTs.pgp
Description: PGP signature
