From 33343901dabdc08991f0378781eccf53d0d7fac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Sch=C3=BCmann?= Date: Thu, 26 Mar 2015 20:39:52 +0000 Subject: MirOTR: fixed ICQ problem as it's dropping all messages with "otr.cypherpunks.ca" in it and thus every manually started session (which then never starts) This change actually improves the invite message as HTML is gone and the message is send in up to two languages (English + user) git-svn-id: http://svn.miranda-ng.org/main/trunk@12506 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirOTR/src/otr.h | 3 +++ plugins/MirOTR/src/svcs_menu.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'plugins/MirOTR') diff --git a/plugins/MirOTR/src/otr.h b/plugins/MirOTR/src/otr.h index 9691cbbfc7..c91c173784 100644 --- a/plugins/MirOTR/src/otr.h +++ b/plugins/MirOTR/src/otr.h @@ -5,6 +5,9 @@ extern OtrlMessageAppOps ops; /// @todo : add OTR version 3 instance tag choice (currently we use the most secure/active one) #define MIROTR_PROTO_HELLO "?OTRv23?" +/* OTR link normally is https://otr.cypherpunks.ca/ but it's blocked by ICQ as of March 2015 (even something like "ot-r.cyp her_ pun ks. ca") + It might be a good idea to use http://wikipedia.org/wiki/Off-the-Record_Messaging instead as it's not yet blocked by ICQ but might still help users to find a client/plugin */ +#define MIROTR_PROTO_HELLO_MSG _T(" has requested an Off-the-Record private conversation. However, you do not have a plugin to support that.\nSee http://wikipedia.org/wiki/Off-the-Record_Messaging for more information.") extern "C" { diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index 4ed3f7a0d9..5467416408 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -14,9 +14,36 @@ int StartOTR(MCONTACT hContact) { if(pol == CONTACT_DEFAULT_POLICY) pol = options.default_policy; lib_cs_lock(); + #ifndef MIROTR_PROTO_HELLO_MSG char *msg = otrl_proto_default_query_msg(MODULENAME, pol); otr_gui_inject_message((void*)hContact, proto, proto, uname, msg ? msg : MIROTR_PROTO_HELLO); free(msg); + #else + TCHAR* nick=ProtoGetNickname(proto); + if(nick){ + TCHAR msg[1024]; + TCHAR* msgend = msg+SIZEOF(msg)-1; + TCHAR* msgoff = msg; + for(const char* c=MIROTR_PROTO_HELLO; *c; *msgoff++=*c++); + *msgoff++ = '\n'; + for(const TCHAR* c=nick; *c && msgoff