summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 0e02fe260a..aa64fb68e7 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -78,19 +78,19 @@ CMStringA MakeJid(const char *jid, const char *resource)
void CJabberProto::UpdateItem(JABBER_LIST_ITEM *pItem, const char *name)
{
- if (name != nullptr) {
- ptrA tszNick(getUStringA(pItem->hContact, "Nick"));
- if (tszNick != nullptr) {
- if (!m_bIgnoreRoster) {
+ if (!m_bIgnoreRoster || db_get_wsm(pItem->hContact, "CList", "MyHandle").IsEmpty()) {
+ if (name != nullptr) {
+ ptrA tszNick(getUStringA(pItem->hContact, "Nick"));
+ if (tszNick != nullptr) {
if (mir_strcmp(pItem->nick, tszNick) != 0)
db_set_utf(pItem->hContact, "CList", "MyHandle", pItem->nick);
else
db_unset(pItem->hContact, "CList", "MyHandle");
}
+ else db_set_utf(pItem->hContact, "CList", "MyHandle", pItem->nick);
}
- else db_set_utf(pItem->hContact, "CList", "MyHandle", pItem->nick);
+ else db_unset(pItem->hContact, "CList", "MyHandle");
}
- else db_unset(pItem->hContact, "CList", "MyHandle");
// check group delimiters
if (pItem->group && m_szGroupDelimiter) {