From 0efd9faae962ad4116b97797956b5e4f25ce344c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 11 Apr 2019 17:58:13 +0300 Subject: Jabber code optimization (cherry picked from commit 21cb5066d970dde709000cdae89c7f8e89addac7) --- protocols/JabberG/src/jabber_chat.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols/JabberG/src/jabber_chat.cpp') 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; -- cgit v1.2.3