From 35c6f6ccbb11f24a1385c5296a0f2b32c0b90dc9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 23 Jan 2017 18:52:14 +0300 Subject: no need to implement the same code in each plugin --- protocols/JabberG/src/jabber_chat.cpp | 4 ++-- protocols/JabberG/src/jabber_misc.cpp | 15 --------------- protocols/JabberG/src/stdafx.h | 4 ---- 3 files changed, 2 insertions(+), 21 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index bc5d850268..6cb09aabc2 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1002,7 +1002,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* mir_snwprintf(buf, L"%s%s%s", szMessage, him->m_tszResourceName, p + 2); } else mir_wstrncpy(buf, szMessage, _countof(buf)); - UnEscapeChatTags(buf); + Chat_UnescapeTags(buf); ppro->m_ThreadInfo->send( XmlNode(L"message") << XATTR(L"to", item->jid) << XATTR(L"type", L"groupchat") @@ -1385,7 +1385,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam) int64_t id = (_time64(0) << 16) + (GetTickCount() & 0xFFFF); wchar_t *buf = NEWWSTR_ALLOCA(gch->ptszText); - UnEscapeChatTags(buf); + Chat_UnescapeTags(buf); m_ThreadInfo->send( XmlNode(L"message") << XATTR(L"id", _i64tot(id, tszID, 36)) << XATTR(L"to", item->jid) << XATTR(L"type", L"groupchat") << XCHILD(L"body", buf)); diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index ee64e3c348..4950875dd3 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -240,21 +240,6 @@ void CJabberProto::SetServerStatus(int iNewStatus) ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); } -// Process a string, and double all % characters, according to chat.dll's restrictions -// Returns a pointer to the new string (old one is not freed) - -wchar_t* UnEscapeChatTags(wchar_t* str_in) -{ - wchar_t *s = str_in, *d = str_in; - while (*s) { - if (*s == '%' && s[1] == '%') - s++; - *d++ = *s++; - } - *d = 0; - return str_in; -} - ////////////////////////////////////////////////////////////////////////// // update MirVer with data for active resource diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index df2533fbfc..e3e320f2c9 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -666,10 +666,6 @@ void g_MenuInit(); void g_MenuUninit(); int g_OnToolbarInit(WPARAM, LPARAM); -//---- jabber_misc.c ------------------------------------------------ - -wchar_t* UnEscapeChatTags(wchar_t* str_in); - //---- jabber_adhoc.cpp --------------------------------------------- struct CJabberAdhocStartupParams -- cgit v1.2.3