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/PasteIt/src/PasteIt.cpp | 4 ++-- plugins/PasteIt/src/stdafx.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/PasteIt/src') diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 0cfc630cee..80398f6911 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -109,7 +109,7 @@ static void PasteIt(MCONTACT hContact, int mode) else if (hContact != NULL && pasteToWeb->szFileLink[0] != 0) { char *szProto = Proto_GetBaseAccountName(hContact); if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) { - BOOL isChat = db_get_b(hContact, szProto, "ChatRoom", 0); + bool isChat = Contact_IsGroupChat(hContact, szProto); if (Options::instance->autoSend) { if (!isChat) { DBEVENTINFO dbei = {}; @@ -323,7 +323,7 @@ static int WindowEvent(WPARAM, MessageWindowEventData* lParam) if (lParam->uType == MSG_WINDOW_EVT_OPEN) { char *szProto = Proto_GetBaseAccountName(lParam->hContact); if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND) { - if (db_get_b(lParam->hContact, szProto, "ChatRoom", 0)) { + if (Contact_IsGroupChat(lParam->hContact, szProto)) { (*contactWindows)[lParam->hContact] = lParam->hwndInput; } } diff --git a/plugins/PasteIt/src/stdafx.h b/plugins/PasteIt/src/stdafx.h index e747eb8f97..c6f05d3133 100644 --- a/plugins/PasteIt/src/stdafx.h +++ b/plugins/PasteIt/src/stdafx.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3