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 --- src/core/stdfile/src/file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/stdfile') diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index e257013663..39e24e7c50 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -35,7 +35,7 @@ static HGENMENU hSRFileMenuItem; wchar_t* GetContactID(MCONTACT hContact) { char *szProto = Proto_GetBaseAccountName(hContact); - if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1) + if (Contact_IsGroupChat(hContact, szProto)) if (wchar_t *theValue = db_get_wsa(hContact, szProto, "ChatRoomID")) return theValue; @@ -288,7 +288,7 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM) bool bEnabled = false; char *szProto = Proto_GetBaseAccountName(wParam); if (szProto != nullptr) { - bool isChat = db_get_b(wParam, szProto, "ChatRoom", false) != 0; + bool isChat = Contact_IsGroupChat(wParam, szProto); if (CallProtoService(szProto, PS_GETCAPS, isChat ? PFLAGNUM_4 : PFLAGNUM_1, 0) & (isChat ? PF4_GROUPCHATFILES : PF1_FILESEND)) { if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_OFFLINEFILES) bEnabled = true; -- cgit v1.2.3