summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-27 23:43:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-27 23:43:06 +0300
commite441a31e9f912fc8e9244d16560565559b1924d2 (patch)
treee9d47703f0e56bb5745e7e4e842d14ce989fe86d /protocols/Gadu-Gadu/src
parent91811190c158e4ff97cc94ef93415c12ddf738ed (diff)
end of manual experiments with CList/NotOnList
Diffstat (limited to 'protocols/Gadu-Gadu/src')
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
2 files changed, 5 insertions, 7 deletions
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"));