summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/New_GPG/src')
-rw-r--r--plugins/New_GPG/src/icons.cpp4
-rw-r--r--plugins/New_GPG/src/init.cpp4
-rwxr-xr-xplugins/New_GPG/src/messages.cpp8
-rw-r--r--plugins/New_GPG/src/metacontacts.cpp46
-rw-r--r--plugins/New_GPG/src/metacontacts.h1
-rw-r--r--plugins/New_GPG/src/srmm.cpp2
6 files changed, 21 insertions, 44 deletions
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp
index ac41cb8788..2770d28b64 100644
--- a/plugins/New_GPG/src/icons.cpp
+++ b/plugins/New_GPG/src/icons.cpp
@@ -49,7 +49,7 @@ void setClistIcon(MCONTACT hContact)
bool enabled = isContactSecured(hContact);
extern HANDLE g_hCLIcon;
MCONTACT hMC = hContact;
- if(metaIsSubcontact(hContact))
+ if(db_mc_isSub(hContact))
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
hMC = metaGetContact(hContact);
@@ -64,7 +64,7 @@ void setSrmmIcon(MCONTACT h)
MCONTACT hContact = metaIsProtoMetaContacts(h) ? metaGetMostOnline(h) : h;
bool enabled = isContactSecured(hContact);
MCONTACT hMC = NULL;
- if(metaIsSubcontact(hContact))
+ if(db_mc_isSub(hContact))
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
hMC = metaGetContact(hContact);
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index 185cb0d774..633411c44a 100644
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -17,7 +17,7 @@
#include "commonheaders.h"
//global variables
-bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bPresenceSigning = false, bIsMiranda09 = false, bMetaContacts = false, bFileTransfers = false, bSameAction = false, bAutoExchange = false, bStripTags = false, tabsrmm_used = false;
+bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bPresenceSigning = false, bIsMiranda09 = false, bFileTransfers = false, bSameAction = false, bAutoExchange = false, bStripTags = false, tabsrmm_used = false;
TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
list <JabberAccount*> Accounts;
@@ -140,8 +140,6 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
sid.szTooltip = LPGEN("GPG Turn on encryption");
Srmm_AddIcon(&sid);
- bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT) != 0;
-
if(bJabberAPI && bIsMiranda09)
GetJabberInterface(0,0);
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index af59cbe729..cada448160 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -319,7 +319,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags
str.insert(0, inopentag);
str.append(inclosetag);
}
- if(metaIsSubcontact(hContact))
+ if(db_mc_isSub(hContact))
{
char *msg = mir_strdup(toUTF8(str).c_str());
HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags|DBEF_READ));
@@ -338,7 +338,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags
}
if(db_get_b(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 0))
{
- if(metaIsSubcontact(hContact))
+ if(db_mc_isSub(hContact))
{
HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags|DBEF_READ));
HistoryLog(metaGetContact(hContact), db_event(msg, timestamp, 0, dbflags));
@@ -487,7 +487,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
db_set_b(ccs->hContact, szGPGModuleName, "bAlwatsTrust", 1);
setSrmmIcon(ccs->hContact);
setClistIcon(ccs->hContact);
- if(metaIsSubcontact(ccs->hContact))
+ if(db_mc_isSub(ccs->hContact))
{
setSrmmIcon(metaGetContact(ccs->hContact));
setClistIcon(metaGetContact(ccs->hContact));
@@ -767,7 +767,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags)
str_event.insert(0, toUTF8(outopentag));
str_event.append(toUTF8(outclosetag));
}
- /*if(metaIsSubcontact(hContact))
+ /*if(db_mc_isSub(hContact))
{
hcontact_data[metaGetContact(hContact)].msgs_to_pass.push_back(str_event);
if(bDebugLog)
diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp
index 876071191a..9896393cbc 100644
--- a/plugins/New_GPG/src/metacontacts.cpp
+++ b/plugins/New_GPG/src/metacontacts.cpp
@@ -16,67 +16,47 @@
#include "commonheaders.h"
-extern bool bMetaContacts;
-
bool metaIsProtoMetaContacts(MCONTACT hContact)
{
- if(bMetaContacts) {
- LPSTR proto = GetContactProto(hContact);
- if( proto && strcmp(proto,"MetaContacts")==0 ) {
- return true;
- }
- }
+ LPSTR proto = GetContactProto(hContact);
+ if(proto && strcmp(proto,"MetaContacts") == 0)
+ return true;
+
return false;
}
bool metaIsDefaultSubContact(MCONTACT hContact)
{
- if(bMetaContacts)
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,hContact,0),0)==hContact;
- return false;
+ return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, db_mc_getMeta(hContact), 0) == hContact;
}
MCONTACT metaGetContact(MCONTACT hContact)
{
- if(bMetaContacts)
- if(metaIsSubcontact(hContact))
- return (MCONTACT)CallService(MS_MC_GETMETACONTACT,hContact,0);
+ if(db_mc_isSub(hContact))
+ return db_mc_getMeta(hContact);
return NULL;
}
-bool metaIsSubcontact(MCONTACT hContact)
-{
- if(bMetaContacts)
- return CallService(MS_MC_GETMETACONTACT,hContact,0) != 0;
- return false;
-}
-
MCONTACT metaGetMostOnline(MCONTACT hContact)
{
- if(bMetaContacts)
- if(metaIsProtoMetaContacts(hContact))
- return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,hContact,0);
+ if(metaIsProtoMetaContacts(hContact))
+ return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,hContact,0);
return NULL;
}
MCONTACT metaGetDefault(MCONTACT hContact)
{
- if(bMetaContacts)
- if(metaIsProtoMetaContacts(hContact))
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,hContact,0);
+ if(metaIsProtoMetaContacts(hContact))
+ return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,hContact,0);
return NULL;
}
DWORD metaGetContactsNum(MCONTACT hContact)
{
- if(bMetaContacts)
- return CallService(MS_MC_GETNUMCONTACTS, hContact, 0);
- return 0;
+ return CallService(MS_MC_GETNUMCONTACTS, hContact, 0);
}
MCONTACT metaGetSubcontact(MCONTACT hContact, int num)
{
- if(bMetaContacts)
- return (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, (LPARAM)num);
- return 0;
+ return (MCONTACT)CallService(MS_MC_GETSUBCONTACT, hContact, (LPARAM)num);
}
diff --git a/plugins/New_GPG/src/metacontacts.h b/plugins/New_GPG/src/metacontacts.h
index 396c3bcb43..d908d1e8a8 100644
--- a/plugins/New_GPG/src/metacontacts.h
+++ b/plugins/New_GPG/src/metacontacts.h
@@ -17,7 +17,6 @@
bool metaIsProtoMetaContacts(MCONTACT hContact);
bool metaIsDefaultSubContact(MCONTACT hContact) ;
MCONTACT metaGetContact(MCONTACT hContact);
-bool metaIsSubcontact(MCONTACT hContact);
MCONTACT metaGetMostOnline(MCONTACT hContact);
MCONTACT metaGetDefault(MCONTACT hContact);
DWORD metaGetContactsNum(MCONTACT hContact);
diff --git a/plugins/New_GPG/src/srmm.cpp b/plugins/New_GPG/src/srmm.cpp
index aab34ee826..24c00fd878 100644
--- a/plugins/New_GPG/src/srmm.cpp
+++ b/plugins/New_GPG/src/srmm.cpp
@@ -41,7 +41,7 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam)
hMeta = hContact;
hContact = metaGetMostOnline(hContact); // возьмем тот, через который пойдет сообщение
}
- else if(metaIsSubcontact(hContact))
+ else if(db_mc_isSub(hContact))
hMeta = metaGetContact(hContact);
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if(strcmp(sicd->szModule, szGPGModuleName))