summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-04-05 10:25:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-04-05 10:25:42 +0300
commit0fb3573a8a849c92574ce4b04103643fdfa95cbd (patch)
treef1aa747d44a5951f9f856887eb8663b43a5bfdcf
parent161db8693fb9488fabdec40a9d899bb7af8f9cfb (diff)
Jabber: final fix for Chinese in nick change dialog
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 06e538e573..cbbada664e 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -739,11 +739,10 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
CMStringW szBuffer, szTitle;
szTitle.Format(TranslateT("Change nickname in <%s>"), item->name ? item->name : Utf2T(item->jid));
if (item->nick)
- szBuffer = item->nick;
+ szBuffer = Utf2T(item->nick);
if (param->ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
T2Utf newNick(szBuffer);
- replaceStr(item->nick, newNick);
param->ppro->SendPresenceTo(param->ppro->m_iStatus, MakeJid(item->jid, newNick));
}
}
@@ -824,10 +823,6 @@ void CJabberProto::GroupchatProcessPresence(const TiXmlElement *node)
const char *nick = cnick ? cnick : (r && r->m_szNick ? r->m_szNick : resource);
- // process custom nick change
- if (cnick && r && r->m_szNick && mir_strcmp(cnick, r->m_szNick))
- r->m_szNick = mir_strdup(cnick);
-
const TiXmlElement *itemNode = nullptr;
auto *xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
if (xNode)
@@ -841,6 +836,7 @@ void CJabberProto::GroupchatProcessPresence(const TiXmlElement *node)
GcInit(item);
item->iChatState = 0;
+ replaceStr(item->nick, nick);
// Update status of room participant
int status = ID_STATUS_ONLINE;
@@ -851,6 +847,10 @@ void CJabberProto::GroupchatProcessPresence(const TiXmlElement *node)
else if (!mir_strcmp(pszStatus, "chat")) status = ID_STATUS_FREECHAT;
}
+ // process custom nick change
+ if (cnick && r && r->m_szNick && mir_strcmp(cnick, r->m_szNick))
+ r->m_szNick = mir_strdup(cnick);
+
const char *str = XmlGetChildText(node, "status");
int priority = XmlGetChildInt(node, "priority");
int newRes = ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) ? GC_EVENT_JOIN : 0;