summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-27 20:50:07 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-27 20:50:07 +0000
commit13c033c257f6c083b0c46b4fa28601db5a0b6335 (patch)
treecb6c2d292df718d1cddd885ad1029a0b81f1b7e4 /plugins/MirOTR
parent367e673a5a3d4d49b2ef1bfbf57a1a5828a2d174 (diff)
MS_MC_GETMETACONTACT => db_mc_getMeta
git-svn-id: http://svn.miranda-ng.org/main/trunk@8317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r--plugins/MirOTR/MirOTR/src/dbfilter.cpp4
-rw-r--r--plugins/MirOTR/MirOTR/src/mirotrmenu.cpp2
-rw-r--r--plugins/MirOTR/MirOTR/src/options.cpp1
-rw-r--r--plugins/MirOTR/MirOTR/src/options.h2
-rw-r--r--plugins/MirOTR/MirOTR/src/svcs_menu.cpp6
-rw-r--r--plugins/MirOTR/MirOTR/src/svcs_srmm.cpp4
6 files changed, 9 insertions, 10 deletions
diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp
index c3ebb7f95a..953ac2adfc 100644
--- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp
+++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp
@@ -196,7 +196,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam)
if (!db_event_get((HANDLE)lParam, &info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
MCONTACT hSub;
- if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
+ if((hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
hContact = hSub;
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
@@ -252,7 +252,7 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) {
if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
MCONTACT hContact = mwd->hContact, hTemp;
- if(options.bHaveMetaContacts && (hTemp = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
+ if((hTemp = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
hContact = hTemp;
if (!CallService(MS_PROTO_ISPROTOONCONTACT, hContact, (LPARAM)MODULENAME))
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
index 65d489d1cc..317fcd749f 100644
--- a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
+++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
@@ -86,7 +86,7 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam,LPARAM)
return TRUE;
MCONTACT hContact = (MCONTACT)pcpp->wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
+ if((hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
hContact = hSub;
TrustLevel level = ( TrustLevel )otr_context_get_trust(otrl_context_find_miranda(otr_user_state, hContact));
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp
index b6792618d5..59e32e72b2 100644
--- a/plugins/MirOTR/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/MirOTR/src/options.cpp
@@ -89,7 +89,6 @@ void LoadOptions() {
options.end_offline = (db_get_b(0, MODULENAME, "EndOffline", 1) == 1);
options.end_window_close = (db_get_b(0, MODULENAME, "EndWindowClose", 0) == 1);
- options.bHaveMetaContacts = 0 != ServiceExists(MS_MC_GETMETACONTACT);
options.bHavePopups = 0 != ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_SHOWMESSAGE);
options.bHaveSecureIM = 0 != ServiceExists("SecureIM/IsContactSecured");
options.bHaveButtonsBar = 0 != ServiceExists(MS_BB_ADDBUTTON);
diff --git a/plugins/MirOTR/MirOTR/src/options.h b/plugins/MirOTR/MirOTR/src/options.h
index ee74c7b9cc..27a3f06223 100644
--- a/plugins/MirOTR/MirOTR/src/options.h
+++ b/plugins/MirOTR/MirOTR/src/options.h
@@ -32,7 +32,7 @@ typedef struct {
bool end_offline, end_window_close;
// temporary options
- bool bHaveMetaContacts, bHavePopups, bHaveSecureIM, bHaveButtonsBar;
+ bool bHavePopups, bHaveSecureIM, bHaveButtonsBar;
} Options;
diff --git a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp
index 0db55124ea..010ef9077b 100644
--- a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp
+++ b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp
@@ -26,7 +26,7 @@ int StartOTR(MCONTACT hContact) {
INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM lParam)
{
MCONTACT hSub;
- if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
+ if((hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
hContact = hSub;
if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) {
@@ -46,7 +46,7 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM lParam)
INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM lParam)
{
MCONTACT hSub;
- if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
+ if((hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
hContact = hSub;
if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) {
@@ -100,7 +100,7 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM lParam)
INT_PTR SVC_VerifyOTR(WPARAM hContact, LPARAM lParam)
{
MCONTACT hSub;
- if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
+ if((hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0)) != 0)
hContact = hSub;
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
index fcc4b5e85a..fc273282b2 100644
--- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
@@ -69,8 +69,8 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level)
if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, hContact, (LPARAM)&button);
db_set_dw(hContact, MODULENAME, "TrustLevel", level);
- if (!chat_room && options.bHaveMetaContacts) {
- MCONTACT hMeta = (MCONTACT)CallService(MS_MC_GETMETACONTACT, hContact, 0);
+ if (!chat_room) {
+ MCONTACT hMeta = db_mc_getMeta(hContact);
MCONTACT hMostOnline = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
if(hMeta && hContact == hMostOnline)
SetEncryptionStatus(hMeta, level);