From 9fd57c17a6432b675821f9aa21726432022e8882 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 Jun 2020 19:16:03 +0300 Subject: constant unification --- protocols/JabberG/src/jabber_proto.cpp | 3 --- protocols/JabberG/src/jabber_thread.cpp | 7 ++----- protocols/JabberG/src/stdafx.h | 3 +++ 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index dfcea18fb0..de68283c16 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -888,9 +888,6 @@ HANDLE CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, w //////////////////////////////////////////////////////////////////////////////////////// // JabberSendMessage - sends a message -static char PGP_PROLOG[] = "-----BEGIN PGP MESSAGE-----\r\n\r\n"; -static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n"; - int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *pszSrc) { char szClientJid[JABBER_MAX_JID_LEN]; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index e911d7f33d..da88826cee 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1315,13 +1315,10 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) else { // XEP-0027 is not strict enough, different clients have different implementations // additional validation is required - char *prolog = "-----BEGIN PGP MESSAGE-----"; - char *prolog_newline = "\r\n\r\n"; - char *epilog = "\r\n-----END PGP MESSAGE-----\r\n"; CMStringA tempstring; - if (!strstr(ptszText, prolog)) - tempstring.Format("%s%s%s%s", prolog, prolog_newline, ptszText, epilog); + if (!strstr(ptszText, PGP_PROLOG)) + tempstring.Format("%s%s%s", PGP_PROLOG, ptszText, PGP_EPILOG); else tempstring = ptszText; diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index e744ff7075..37c1d863c4 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -163,6 +163,9 @@ protected: #define JABBER_GC_MSG_SLAP LPGEN("/me slaps %s around a bit with a large trout") #define JABBER_SERVER_URL "https://xmpp.net/services.php" +#define PGP_PROLOG "-----BEGIN PGP MESSAGE-----\r\n\r\n" +#define PGP_EPILOG "\r\n-----END PGP MESSAGE-----\r\n" + // registered db event types #define EVENTTYPE_JABBER_CHATSTATES 2000 #define JS_DB_GETEVENTTEXT_CHATSTATES "/GetEventText2000" -- cgit v1.2.3