summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-25 19:16:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-25 19:16:03 +0300
commit9fd57c17a6432b675821f9aa21726432022e8882 (patch)
treeaec284e2d97dacb4197cc7474a9b24610bd47919 /protocols/JabberG
parent648729e8dd7fca6ede8dad8c49bb7f5531073910 (diff)
constant unification
Diffstat (limited to 'protocols/JabberG')
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp3
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp7
-rwxr-xr-xprotocols/JabberG/src/stdafx.h3
3 files changed, 5 insertions, 8 deletions
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"