diff options
author | George Hazan <ghazan@miranda.im> | 2019-09-26 22:15:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-09-26 22:15:57 +0300 |
commit | 15c49e3fc4cf033fffbf79e9f68a0405d5a95d14 (patch) | |
tree | 3ba342e3e8645156102d3c5f3f9a1b5dafe4c22c /plugins/MirandaG15/src | |
parent | d095047014348c9e8dd72a72dc59b2abd22bbf9c (diff) |
Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it
Diffstat (limited to 'plugins/MirandaG15/src')
-rw-r--r-- | plugins/MirandaG15/src/CAppletManager.cpp | 4 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CContactList.cpp | 4 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CEventScreen.cpp | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 602fec49f4..1942853761 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -1123,7 +1123,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) Event.hContact = NULL; // Ignore events from hidden chatrooms, except for join events - if (gce->pszID.w != nullptr && db_get_b(Event.hContact, "CList", "Hidden", 0)) { + if (gce->pszID.w != nullptr && Clist_IsHidden(Event.hContact)) { if (gce->iType == GC_EVENT_JOIN && pHistory) pHistory->LUsers.push_back(toTstring(gce->pszNick.w)); @@ -1645,7 +1645,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) else if (!strcmp(dbcws->szModule, "CList")) { if (!strcmp(dbcws->szSetting, "Hidden")) { Event.eType = EVENT_CONTACT_HIDDEN; - Event.iValue = db_get_b(hContact, "CList", "Hidden", 0); + Event.iValue = Clist_IsHidden(hContact); } else if (!strcmp(dbcws->szSetting, "Group")) { Event.eType = EVENT_CONTACT_GROUP; diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index c385b7965b..1331ef94e9 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -202,12 +202,12 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) return true;
if (CConfig::GetBoolSetting(CLIST_USEIGNORE)) {
- if (db_get_b(pEntry->hHandle, "CList", "Hidden", 0))
+ if (Clist_IsHidden(pEntry->hHandle))
return false;
if (db_mc_isSub(pEntry->hHandle)) {
MCONTACT hMetaContact = db_mc_getMeta(pEntry->hHandle);
- if (db_get_b(hMetaContact, "CList", "Hidden", 0))
+ if (Clist_IsHidden(hMetaContact))
return false;
}
}
diff --git a/plugins/MirandaG15/src/CEventScreen.cpp b/plugins/MirandaG15/src/CEventScreen.cpp index 169a2caef9..c307a5715b 100644 --- a/plugins/MirandaG15/src/CEventScreen.cpp +++ b/plugins/MirandaG15/src/CEventScreen.cpp @@ -186,8 +186,7 @@ void CEventScreen::OnLCDButtonDown(int iButton) char *szProto = GetContactProto(pEntry->hContact);
CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(toTstring(szProto));
- if (pIRCCon && db_get_b(pEntry->hContact, szProto, "ChatRoom", 0) != 0 &&
- db_get_b(pEntry->hContact, "CList", "Hidden", 0))
+ if (pIRCCon && db_get_b(pEntry->hContact, szProto, "ChatRoom", 0) != 0 && Clist_IsHidden(pEntry->hContact))
return;
CAppletManager::GetInstance()->ActivateChatScreen(pEntry->hContact);
|