From 15c49e3fc4cf033fffbf79e9f68a0405d5a95d14 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Sep 2019 22:15:57 +0300 Subject: Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it --- protocols/JabberG/src/jabber_chat.cpp | 4 ++-- protocols/JabberG/src/jabber_events.cpp | 2 +- protocols/JabberG/src/jabber_iq_handlers.cpp | 2 +- protocols/JabberG/src/jabber_iqid.cpp | 2 +- protocols/JabberG/src/jabber_misc.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 8feab67e1b..402d007463 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -330,7 +330,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, const TiXmlElement * else Chat_Control(m_szModuleName, wszRoomJid, SESSION_OFFLINE); - db_unset(item->hContact, "CList", "Hidden"); + Clist_HideContact(item->hContact, false); item->bChatActive = false; if (m_bJabberOnline) { @@ -1346,7 +1346,7 @@ static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, co if (r) ppro->setWord(hContact, "Status", r->m_iStatus); - db_set_b(hContact, "CList", "Hidden", 1); + Clist_HideContact(hContact); ppro->setUString(hContact, "Nick", nick); db_set_dw(hContact, "Ignore", "Mask1", 0); CallService(MS_MSG_SENDMESSAGE, hContact, 0); diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 8bc1189fdf..8aac09a5cc 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -151,7 +151,7 @@ void __cdecl CJabberProto::OnAddContactForever(MCONTACT hContact) SendGetVcard(hContact); - db_unset(hContact, "CList", "Hidden"); + Clist_HideContact(hContact, false); } int __cdecl CJabberProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index ed0ace2ff0..686e531a28 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -257,7 +257,7 @@ BOOL CJabberProto::OnRosterPushRequest(const TiXmlElement*, CJabberIqInfo *pInfo UpdateSubscriptionInfo(item->hContact, item); } else if (isChatRoom(item->hContact)) - db_unset(item->hContact, "CList", "Hidden"); + Clist_HideContact(item->hContact, false); else UpdateSubscriptionInfo(item->hContact, item); } diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index eb528f544b..c15d6cc78b 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -431,7 +431,7 @@ void CJabberProto::OnIqResultGetRoster(const TiXmlElement *iqNode, CJabberIqInfo if (char *p = strchr(wszTitle, '@')) *p = 0; Chat_NewSession(GCW_CHATROOM, m_szModuleName, Utf2T(jid), Utf2T(wszTitle)); - db_unset(hContact, "CList", "Hidden"); + Clist_HideContact(hContact, false); chatRooms.insert((HANDLE)hContact); } else UpdateSubscriptionInfo(hContact, item); diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index f41edad6c6..736e60e854 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -46,7 +46,7 @@ void CJabberProto::AddContactToRoster(const char *jid, const char *nick, const c void CJabberProto::DBAddAuthRequest(const char *jid, const char *nick) { MCONTACT hContact = DBCreateContact(jid, nick, true, true); - delSetting(hContact, "Hidden"); + Clist_HideContact(hContact, false); DB_AUTH_BLOB blob(hContact, nick, nullptr, nullptr, jid, nullptr); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 3ac61aec58..bdca637d77 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -358,7 +358,7 @@ MCONTACT CJabberProto::AddToListByJID(const char *newJid, DWORD flags) MCONTACT hContact = DBCreateContact(newJid, nullptr, true, false); if (flags & PALF_TEMPORARY) - db_set_b(hContact, "CList", "Hidden", 1); + Clist_HideContact(hContact); return hContact; } -- cgit v1.2.3