summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_chat.cpp')
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 2160784660..17b824d84b 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -130,14 +130,11 @@ SESSION_INFO* CJabberProto::GcInit(JABBER_LIST_ITEM *item)
}
}
- ptrA tszNick(getUStringA(si->hContact, "MyNick"));
- if (tszNick != nullptr) {
- if (!mir_strcmp(tszNick, szNick))
- delSetting(si->hContact, "MyNick");
- else
- setUString(si->hContact, "MyNick", item->nick);
- }
- else setUString(si->hContact, "MyNick", item->nick);
+ ptrA szMyNick(getUStringA(si->hContact, "MyNick"));
+ if (szMyNick && getMStringU("Nick") == szMyNick)
+ delSetting(si->hContact, "MyNick");
+ else
+ setUString(si->hContact, "MyNick", item->nick);
ptrA passw(getUStringA(si->hContact, "Password"));
if (mir_strcmp(passw, item->password)) {