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/SkypeWeb | |
parent | d095047014348c9e8dd72a72dc59b2abd22bbf9c (diff) |
Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index b75fa2509f..cfc268094f 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -107,7 +107,7 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) if (hContact == NULL) {
hContact = AddContact(user_id, true);
setWord(hContact, "Status", ID_STATUS_ONLINE);
- db_set_b(hContact, "CList", "Hidden", 1);
+ Clist_HideContact(hContact);
setWString(hContact, "Nick", gch->ptszUID);
}
CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 2961cda97d..57fcdc1355 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -181,11 +181,11 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) else setByte(hContact, "Grant", 1);
if (item["blocked"].as_bool()) {
- db_set_b(hContact, "CList", "Hidden", 1);
+ Clist_HideContact(hContact);
setByte(hContact, "IsBlocked", 1);
}
else {
- db_unset(hContact, "CList", "Hidden");
+ Clist_HideContact(hContact, false);
delSetting(hContact, "IsBlocked");
}
@@ -283,9 +283,8 @@ INT_PTR CSkypeProto::BlockContact(WPARAM hContact, LPARAM) void CSkypeProto::OnBlockContact(const NETLIBHTTPREQUEST *response, void *p)
{
MCONTACT hContact = (DWORD_PTR)p;
- if (response == nullptr)
- return;
- db_set_b(hContact, "CList", "Hidden", 1);
+ if (response != nullptr)
+ Clist_HideContact(hContact);
}
INT_PTR CSkypeProto::UnblockContact(WPARAM hContact, LPARAM)
@@ -300,6 +299,6 @@ void CSkypeProto::OnUnblockContact(const NETLIBHTTPREQUEST *response, void *p) return;
MCONTACT hContact = (DWORD_PTR)p;
- db_set_b(hContact, "CList", "Hidden", 0);
+ Clist_HideContact(hContact, false);
delSetting(hContact, "IsBlocked");
}
|