From fd1139fc1959a9988143839d3224778d9ce0bbdd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 May 2020 21:15:35 +0300 Subject: Jabber: if we ignore roster, thy shalt update existing nicks either --- protocols/JabberG/src/jabber_iq_handlers.cpp | 10 ++++++---- protocols/JabberG/src/jabber_iqid.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 2761e53821..d29f87b706 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -218,10 +218,12 @@ bool CJabberProto::OnRosterPushRequest(const TiXmlElement*, CJabberIqInfo *pInfo if (name != nullptr) { ptrA tszNick(getUStringA(hContact, "Nick")); if (tszNick != nullptr) { - if (mir_strcmp(nick, tszNick) != 0) - db_set_utf(hContact, "CList", "MyHandle", nick); - else - db_unset(hContact, "CList", "MyHandle"); + if (!m_bIgnoreRoster) { + if (mir_strcmp(nick, tszNick) != 0) + db_set_utf(hContact, "CList", "MyHandle", nick); + else + db_unset(hContact, "CList", "MyHandle"); + } } else db_set_utf(hContact, "CList", "MyHandle", nick); } diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 64fe8acbfc..a37df3e741 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -423,10 +423,12 @@ void CJabberProto::OnIqResultGetRoster(const TiXmlElement *iqNode, CJabberIqInfo if (name != nullptr) { ptrA tszNick(getUStringA(hContact, "Nick")); if (tszNick != nullptr) { - if (mir_strcmp(nick, tszNick) != 0) - db_set_utf(hContact, "CList", "MyHandle", nick); - else - db_unset(hContact, "CList", "MyHandle"); + if (!m_bIgnoreRoster) { + if (mir_strcmp(nick, tszNick) != 0) + db_set_utf(hContact, "CList", "MyHandle", nick); + else + db_unset(hContact, "CList", "MyHandle"); + } } else db_set_utf(hContact, "CList", "MyHandle", nick); } -- cgit v1.2.3