diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-23 18:52:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-23 18:52:14 +0300 |
commit | 35c6f6ccbb11f24a1385c5296a0f2b32c0b90dc9 (patch) | |
tree | 3e40f085a7114254966ddadafd1b92388c85b54e /protocols/JabberG | |
parent | ac6a2d3c5a668324d4115305a621a81e4b5d99fb (diff) |
no need to implement the same code in each plugin
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_misc.cpp | 15 | ||||
-rw-r--r-- | protocols/JabberG/src/stdafx.h | 4 |
3 files changed, 2 insertions, 21 deletions
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
|