From cd4272ca22d47cdf673bfb0e5ec353acca3d9569 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 16 Jul 2022 21:23:06 +0300 Subject: Contact_IsGroupChat - a helper to detect chat rooms --- plugins/SeenPlugin/src/menu.cpp | 2 +- plugins/SeenPlugin/src/userinfo.cpp | 2 +- plugins/SeenPlugin/src/utils.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/SeenPlugin') diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index fc62ca1d0f..c24345000a 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -37,7 +37,7 @@ INT_PTR MenuitemClicked(WPARAM hContact, LPARAM) int BuildContactMenu(WPARAM hContact, LPARAM) { char *szProto = Proto_GetBaseAccountName(hContact); - if (!IsWatchedProtocol(szProto) || db_get_b(hContact, szProto, "ChatRoom", false) || !g_plugin.getByte("MenuItem", 1)) { + if (!IsWatchedProtocol(szProto) || Contact_IsGroupChat(hContact, szProto) || !g_plugin.getByte("MenuItem", 1)) { Menu_ShowItem(hmenuitem, false); return 0; } diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 1a323a5e11..fce8288f05 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -63,7 +63,7 @@ struct UserinfoDlg : public CUserInfoPageDlg int UserinfoInit(WPARAM wparam, LPARAM hContact) { char *szProto = Proto_GetBaseAccountName(hContact); - if (IsWatchedProtocol(szProto) && !db_get_b(hContact, szProto, "ChatRoom", false)) { + if (IsWatchedProtocol(szProto) && !Contact_IsGroupChat(hContact, szProto)) { USERINFOPAGE uip = {}; uip.szTitle.a = LPGEN("Last seen"); uip.pDialog = new UserinfoDlg(); diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index ee2089f5a5..1a3bee9e55 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -555,7 +555,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) g_plugin.setByte(hContact, "Offline", 0); } } - else if (hContact && IsWatchedProtocol(cws->szModule) && !db_get_b(hContact, cws->szModule, "ChatRoom", false)) { + else if (hContact && IsWatchedProtocol(cws->szModule) && !Contact_IsGroupChat(hContact, cws->szModule)) { // here we will come when //Status is changed or it is idle event and if is watched if (Proto_GetStatus(cws->szModule) > ID_STATUS_OFFLINE) { mir_cslock lck(csContacts); -- cgit v1.2.3