summaryrefslogtreecommitdiff
path: root/plugins/NoHistory
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NoHistory')
-rw-r--r--plugins/NoHistory/src/dllmain.cpp10
-rw-r--r--plugins/NoHistory/src/options.cpp10
-rw-r--r--plugins/NoHistory/src/stdafx.h1
3 files changed, 6 insertions, 15 deletions
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp
index a4b580fa84..8ac0519b22 100644
--- a/plugins/NoHistory/src/dllmain.cpp
+++ b/plugins/NoHistory/src/dllmain.cpp
@@ -137,8 +137,7 @@ INT_PTR ServiceClear(WPARAM hContact, LPARAM)
int PrebuildContactMenu(WPARAM hContact, LPARAM)
{
bool remove = g_plugin.getByte(hContact, DBSETTING_REMOVE) != 0;
- char *proto = Proto_GetBaseAccountName(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
+ bool chat_room = Contact_IsGroupChat(hContact);
if (chat_room)
Menu_ShowItem(hMenuToggle, false);
@@ -175,8 +174,7 @@ int WindowEvent(WPARAM, LPARAM lParam)
break;
case MSG_WINDOW_EVT_OPEN:
- char *proto = Proto_GetBaseAccountName(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
+ bool chat_room = Contact_IsGroupChat(hContact);
int remove = g_plugin.getByte(hContact, DBSETTING_REMOVE) != 0;
for (int i = 0; i < 2; ++i)
@@ -195,9 +193,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam)
if (sicd->flags & MBCF_RIGHTBUTTON) return 0; // ignore right-clicks
if (mir_strcmp(sicd->szModule, MODULENAME) != 0) return 0; // not our event
- char *proto = Proto_GetBaseAccountName(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
- if (!chat_room)
+ if (!Contact_IsGroupChat(hContact))
ServiceToggle(hContact, 0);
return 0;
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp
index dd613dc0ae..43b81ea040 100644
--- a/plugins/NoHistory/src/options.cpp
+++ b/plugins/NoHistory/src/options.cpp
@@ -64,10 +64,7 @@ class CDlgOptionsDlg : public CDlgBase
void SetAllContactIcons()
{
for (auto &hContact : Contacts()) {
- char *proto = Proto_GetBaseAccountName(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
-
- if (!chat_room) {
+ if (!Contact_IsGroupChat(hContact)) {
HANDLE hItem = clist.FindContact(hContact);
if (hItem) {
bool disabled = (g_plugin.getByte(hContact, DBSETTING_REMOVE) == 1);
@@ -129,10 +126,7 @@ public:
g_plugin.bEnabledForNew = clist.GetExtraImage(hItemNew, 0);
for (auto &hContact : Contacts()) {
- char *proto = Proto_GetBaseAccountName(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
-
- if (!chat_room) {
+ if (!Contact_IsGroupChat(hContact)) {
HANDLE hItem = clist.FindContact(hContact);
if (hItem) {
int iImage = clist.GetExtraImage(hItem, 0);
diff --git a/plugins/NoHistory/src/stdafx.h b/plugins/NoHistory/src/stdafx.h
index 3810ddfb6c..5290f2e7ed 100644
--- a/plugins/NoHistory/src/stdafx.h
+++ b/plugins/NoHistory/src/stdafx.h
@@ -8,6 +8,7 @@
#include <m_database.h>
#include <m_clist.h>
#include <m_clc.h>
+#include <m_contacts.h>
#include <m_gui.h>
#include <m_langpack.h>
#include <m_protocols.h>