From e441a31e9f912fc8e9244d16560565559b1924d2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 27 Sep 2019 23:43:06 +0300 Subject: end of manual experiments with CList/NotOnList --- protocols/JabberG/src/jabber_disco.cpp | 2 +- protocols/JabberG/src/jabber_misc.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/JabberG/src/jabber_thread.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 0b63c8b10d..1b0ddb05e7 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -1293,7 +1293,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_ROSTER: { MCONTACT hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), false, false); - db_unset(hContact, "CList", "NotOnList"); + Contact_PutOnList(hContact); JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid(), hContact); item->bUseResource = true; } diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index c5f2534707..e4693220ae 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -86,7 +86,7 @@ MCONTACT CJabberProto::DBCreateContact(const char *jid, const char *nick, bool t if (nick != nullptr && *nick != '\0') setUString(hNewContact, "Nick", nick); if (temporary) - db_set_b(hNewContact, "CList", "NotOnList", 1); + Contact_RemoveFromList(hNewContact); else SendGetVcard(hNewContact); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 5e31b10f3d..0122da30ba 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -424,7 +424,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent) if (MCONTACT hContact = AddToListByJID(blob.get_email(), 0)) { // Trigger actual add by removing the "NotOnList" added by AddToListByJID() // See AddToListByJID() and JabberDbSettingChanged(). - db_unset(hContact, "CList", "NotOnList"); + Contact_PutOnList(hContact); } } } diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index b3446760ff..29e11ee2cc 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1684,7 +1684,7 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info) ListRemoveResource(LIST_ROSTER, from); hContact = HContactFromJID(from); - if (hContact && db_get_b(hContact, "CList", "NotOnList", 0) == 1) { + if (hContact && !Contact_OnList(hContact)) { // remove selfcontact, if where is no more another resources if (item->arResources.getCount() == 1 && ResourceInfoFromJID(info->fullJID)) ListRemoveResource(LIST_ROSTER, info->fullJID); @@ -1734,7 +1734,7 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info) if (item) item->hContact = hContact; setUString(hContact, "Nick", szNick); - db_unset(hContact, "CList", "NotOnList"); + Contact_PutOnList(hContact); } } } -- cgit v1.2.3