summaryrefslogtreecommitdiff
path: root/plugins/PasteIt
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-07-16 21:23:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-07-16 21:23:06 +0300
commitcd4272ca22d47cdf673bfb0e5ec353acca3d9569 (patch)
tree0e2a4879766d8197cdf8a8fb6d5f5033399a0ea4 /plugins/PasteIt
parentd6a052756f58211067a7a67d7e3c1dbe7e6c9465 (diff)
Contact_IsGroupChat - a helper to detect chat rooms
Diffstat (limited to 'plugins/PasteIt')
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp4
-rw-r--r--plugins/PasteIt/src/stdafx.h1
2 files changed, 3 insertions, 2 deletions
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 <newpluginapi.h>
#include <m_clist.h>
+#include <m_contacts.h>
#include <m_langpack.h>
#include <m_netlib.h>
#include <m_xml.h>