summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r--plugins/MirOTR/src/dbfilter.cpp2
-rw-r--r--plugins/MirOTR/src/options.cpp3
-rw-r--r--plugins/MirOTR/src/svcs_menu.cpp2
-rw-r--r--plugins/MirOTR/src/svcs_srmm.cpp17
4 files changed, 10 insertions, 14 deletions
diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp
index 1ef670ca47..09ca8e241d 100644
--- a/plugins/MirOTR/src/dbfilter.cpp
+++ b/plugins/MirOTR/src/dbfilter.cpp
@@ -57,7 +57,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam)
const char *proto = Proto_GetBaseAccountName(hContact);
if (!proto)
return 0;
- if (db_get_b(hContact, proto, "ChatRoom", 0) == 1)
+ if (Contact_IsGroupChat(hContact, proto))
return 0;
if (mir_strcmp(proto, META_PROTO) == 0) {
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp
index f593f738e9..8c607cd386 100644
--- a/plugins/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/src/options.cpp
@@ -523,7 +523,8 @@ class CContactOptionsDlg : public CDlgBase
for (auto &hContact : Contacts()) {
const char *proto = Proto_GetBaseAccountName(hContact);
- if (proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && Proto_IsProtoOnContact(hContact, MODULENAME) // ignore chatrooms
+ if (proto && !Contact_IsGroupChat(hContact, proto) // ignore chatrooms
+ && Proto_IsProtoOnContact(hContact, MODULENAME)
&& mir_strcmp(proto, META_PROTO) != 0) // and MetaContacts
{
lvI.iItem = 0;
diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp
index 50829b2f16..38a1129079 100644
--- a/plugins/MirOTR/src/svcs_menu.cpp
+++ b/plugins/MirOTR/src/svcs_menu.cpp
@@ -184,7 +184,7 @@ int SVC_PrebuildContactMenu(WPARAM hContact, LPARAM)
Menu_ShowItem(hStopItem, false);
const char *proto = Proto_GetBaseAccountName(hContact);
- if (!proto || db_get_b(hContact, proto, "ChatRoom", 0) == 1)
+ if (!proto || Contact_IsGroupChat(hContact, proto))
return 0;
if (proto && mir_strcmp(proto, META_PROTO) == 0) {
diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp
index 9614e4b683..06d5cdae56 100644
--- a/plugins/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/src/svcs_srmm.cpp
@@ -8,10 +8,8 @@ int SVC_IconPressed(WPARAM hContact, LPARAM lParam)
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if (mir_strcmp(sicd->szModule, MODULENAME) == 0) {
- char *proto = Proto_GetBaseAccountName(hContact);
- if (proto && db_get_b(hContact, proto, "ChatRoom", 0))
- return 0;
- ShowOTRMenu(hContact, sicd->clickLocation);
+ if (!Contact_IsGroupChat(hContact))
+ ShowOTRMenu(hContact, sicd->clickLocation);
}
return 0;
@@ -20,8 +18,7 @@ int SVC_IconPressed(WPARAM hContact, LPARAM lParam)
// set SRMM icon status, if applicable
void SetEncryptionStatus(MCONTACT hContact, TrustLevel level)
{
- char *proto = Proto_GetBaseAccountName(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
+ bool chat_room = Contact_IsGroupChat(hContact);
BBButton button = OTRButton;
int flags1 = MBF_HIDDEN, flags2 = MBF_HIDDEN;
@@ -85,13 +82,11 @@ int SVC_ButtonsBarLoaded(WPARAM, LPARAM)
int SVC_ButtonsBarPressed(WPARAM w, LPARAM l)
{
CustomButtonClickData *cbcd = (CustomButtonClickData *)l;
+
if (cbcd->dwButtonId == 0 && !mir_strcmp(cbcd->pszModule, MODULENAME)) {
MCONTACT hContact = (MCONTACT)w;
-
- char *proto = Proto_GetBaseAccountName(hContact);
- if(proto && db_get_b(hContact, proto, "ChatRoom", 0))
- return 0;
- ShowOTRMenu(hContact, cbcd->pt);
+ if (!Contact_IsGroupChat(hContact))
+ ShowOTRMenu(hContact, cbcd->pt);
}
return 0;