diff options
author | George Hazan <ghazan@miranda.im> | 2019-04-11 17:58:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-04-11 18:00:42 +0300 |
commit | 0efd9faae962ad4116b97797956b5e4f25ce344c (patch) | |
tree | 61b5a94dffdf9c949c5d1dad6515c293bd33ddac /protocols/JabberG/src/jabber_chat.cpp | |
parent | 106ee67ae25419a2258c91b2d6e7a00312a51de0 (diff) |
Jabber code optimization
(cherry picked from commit 21cb5066d970dde709000cdae89c7f8e89addac7)
Diffstat (limited to 'protocols/JabberG/src/jabber_chat.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 39ad978519..1a70cecb22 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1195,12 +1195,14 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* case IDM_RJID_ADD:
if (him->m_szRealJid && *him->m_szRealJid) {
- PROTOSEARCHRESULT psr = { 0 };
+ Utf2T jid(him->m_szRealJid);
+ PROTOSEARCHRESULT psr = {};
+ psr.flags = PSR_UNICODE;
psr.cbSize = sizeof(psr);
- psr.id.a = NEWSTR_ALLOCA(him->m_szRealJid);
- if (char *tmp = strchr(psr.id.a, '/'))
+ psr.id.w = jid;
+ if (auto *tmp = wcschr(psr.id.w, '/'))
*tmp = 0;
- psr.nick.a = psr.id.a;
+ psr.nick.w = psr.id.w;
Contact_AddBySearch(ppro->m_szModuleName, &psr, g_clistApi.hwndContactList);
}
break;
|