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/IRCG/src/clist.cpp | 8 ++++---- protocols/IRCG/src/commandmonitor.cpp | 2 +- protocols/IRCG/src/services.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/IRCG/src') diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 5c16b03065..cb4a237209 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -31,7 +31,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas CONTACT usertemp = { name, nullptr, nullptr, false, false, true }; MCONTACT hc = CList_FindContact(&usertemp); - if (hc && db_get_b(hc, "CList", "NotOnList", 0) == 0 && Contact_IsHidden(hc) == 0) + if (hc && Contact_OnList(hc) && !Contact_IsHidden(hc)) bFlag = true; CMStringW contactname = name; contactname += DCCSTRING; @@ -88,7 +88,7 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) MCONTACT hContact = CList_FindContact(user); if (hContact) { if (InList) - db_unset(hContact, "CList", "NotOnList"); + Contact_PutOnList(hContact); setWString(hContact, "Nick", user->name); Contact_Hide(hContact, false); if (SetOnline && getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) @@ -102,9 +102,9 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) Proto_AddToContact(hContact, m_szModuleName); if (InList) - db_unset(hContact, "CList", "NotOnList"); + Contact_PutOnList(hContact); else - db_set_b(hContact, "CList", "NotOnList", 1); + Contact_RemoveFromList(hContact); Contact_Hide(hContact, false); setWString(hContact, "Nick", user->name); setWString(hContact, "Default", user->name); diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 014b34b2c5..25a6dd90c3 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -1063,7 +1063,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg) MCONTACT hContact = CList_FindContact(&user); // check if it should be ignored - if (m_DCCChatIgnore == 1 || m_DCCChatIgnore == 2 && hContact && db_get_b(hContact, "CList", "NotOnList", 0) == 0 && !Contact_IsHidden(hContact)) { + if (m_DCCChatIgnore == 1 || m_DCCChatIgnore == 2 && hContact && Contact_OnList(hContact) && !Contact_IsHidden(hContact)) { CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost; CList_AddDCCChat(pmsg->prefix.sNick, host, dwAdr, iPort); // add a CHAT event to the clist } diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 8b91562f6f..6b05f1efb8 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -803,7 +803,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) CONTACT user = { (wchar_t*)gcmi->pszUID, nullptr, nullptr, false, false, false }; MCONTACT hContact = CList_FindContact(&user); - BOOL bIsInList = (hContact && db_get_b(hContact, "CList", "NotOnList", 0) == 0); + BOOL bIsInList = hContact && Contact_OnList(hContact); nickItems[_countof(nickItems)-1].bDisabled = bIsInList; unsigned long ulAdr = 0; -- cgit v1.2.3