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 /protocols/VKontakte | |
parent | d095047014348c9e8dd72a72dc59b2abd22bbf9c (diff) |
Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 9d54898e85..9a06c9b164 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -1500,7 +1500,7 @@ void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType) hContact, wszType.c_str(),
(int)m_vkOptions.bShowVkDeactivateEvents,
(int)getBool(hContact, "ShowVkDeactivateEvents", true),
- (int)(db_get_b(hContact, "CList", "Hidden", 0) == 0));
+ (int)(!Clist_IsHidden(hContact)));
CVKDeactivateEvent vkDeactivateEvent[] = {
{ L"", Translate("User restored control over own page") },
@@ -1528,7 +1528,7 @@ void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType) (
m_vkOptions.bShowVkDeactivateEvents
&& getBool(hContact, "ShowVkDeactivateEvents", true)
- && (db_get_b(hContact, "CList", "Hidden", 0) == 0)
+ && (!Clist_IsHidden(hContact))
) ? 0 : DBEF_READ);
db_event_add(hContact, &dbei);
}
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 35977921be..4e5ff332e4 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -475,7 +475,7 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam) MCONTACT hContact = FindUser(_wtoi(gch->ptszUID));
if (hContact == 0) {
hContact = FindUser(_wtoi(gch->ptszUID), true);
- db_set_b(hContact, "CList", "Hidden", 1);
+ Clist_HideContact(hContact);
db_set_b(hContact, "CList", "NotOnList", 1);
db_set_dw(hContact, "Ignore", "Mask1", 0);
RetrieveUserInfo(_wtoi(gch->ptszUID));
@@ -723,7 +723,7 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch) hContact = FindUser(cu->m_uid);
if (hContact == 0) {
hContact = FindUser(cu->m_uid, true);
- db_set_b(hContact, "CList", "Hidden", 1);
+ Clist_HideContact(hContact);
db_set_b(hContact, "CList", "NotOnList", 1);
db_set_dw(hContact, "Ignore", "Mask1", 0);
}
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index ecae89cdd5..b73a88103f 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -357,12 +357,11 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, VKContactTy return 0;
if (vkContactType == VKContactType::vkContactMUCUser) {
- db_set_b(hContact, "CList", "Hidden", 1);
+ Clist_HideContact(hContact);
db_set_b(hContact, "CList", "NotOnList", 1);
db_set_dw(hContact, "Ignore", "Mask1", 0);
}
-
CMStringW wszNick, wszValue;
int iValue;
|