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/Gadu-Gadu/src/core.cpp | 10 ++++------ protocols/Gadu-Gadu/src/gg.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'protocols/Gadu-Gadu/src') diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 4e3135be50..08649d5ac0 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1367,8 +1367,7 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh) { // Check if user should be invisible // Or be blocked ? - if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || - db_get_b(hContact, "CList", "NotOnList", 0)) + if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact)) { gg_EnterCriticalSection(&sess_mutex, "notifyuser", 77, "sess_mutex", 1); if (refresh) { @@ -1423,8 +1422,7 @@ void GaduProto::notifyall() int cc = 0; for (auto &hContact : AccContacts()) { if (uins[cc] = getDword(hContact, GG_KEY_UIN, 0)) { - if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || - db_get_b(hContact, "CList", "NotOnList", 0)) + if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact)) types[cc] = GG_USER_OFFLINE; else if (getByte(hContact, GG_KEY_BLOCK, 0)) types[cc] = GG_USER_BLOCKED; @@ -1460,7 +1458,7 @@ MCONTACT GaduProto::getcontact(uin_t uin, int create, int inlist, wchar_t *szNic for (auto &hContact : AccContacts()) { if ((uin_t)getDword(hContact, GG_KEY_UIN, 0) == uin && !isChatRoom(hContact)) { if (inlist) { - db_unset(hContact, "CList", "NotOnList"); + Contact_PutOnList(hContact); Contact_Hide(hContact, false); } return hContact; @@ -1474,7 +1472,7 @@ MCONTACT GaduProto::getcontact(uin_t uin, int create, int inlist, wchar_t *szNic debugLogA("getcontact(): Added buddy: %d", uin); if (!inlist) - db_set_b(hContact, "CList", "NotOnList", 1); + Contact_RemoveFromList(hContact); setDword(hContact, GG_KEY_UIN, (DWORD)uin); setWord(hContact, GG_KEY_STATUS, ID_STATUS_OFFLINE); diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 09a379ecfc..cb5bda1bc6 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -221,7 +221,7 @@ static int gg_prebuildcontactmenu(WPARAM hContact, LPARAM) if (gg == nullptr) return 0; - if (gg->getDword(hContact, GG_KEY_UIN, 0) == gg->getByte(GG_KEY_UIN, 0) || gg->isChatRoom(hContact) || db_get_b(hContact, "CList", "NotOnList", 0)) + if (gg->getDword(hContact, GG_KEY_UIN, 0) == gg->getByte(GG_KEY_UIN, 0) || gg->isChatRoom(hContact) || !Contact_OnList(hContact)) Menu_ShowItem(gg->hBlockMenuItem, false); else Menu_ModifyItem(gg->hBlockMenuItem, gg->getByte(hContact, GG_KEY_BLOCK, 0) ? LPGENW("&Unblock") : LPGENW("&Block")); -- cgit v1.2.3