summaryrefslogtreecommitdiff
path: root/plugins/New_GPG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-09 21:50:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-09 21:50:49 +0000
commit0173277372e2962b8f5703a0ebad7892dda15e6c (patch)
treed1ff4bbecbc00f8d77b9a71c71579de53246303c /plugins/New_GPG
parent61dfdec9a37cc06a6ee624aaaf03df41f821c1c6 (diff)
end of the old MC API
git-svn-id: http://svn.miranda-ng.org/main/trunk@8534 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG')
-rwxr-xr-xplugins/New_GPG/src/main.cpp8
-rw-r--r--plugins/New_GPG/src/metacontacts.cpp16
-rw-r--r--plugins/New_GPG/src/metacontacts.h4
-rwxr-xr-xplugins/New_GPG/src/options.cpp36
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp4
5 files changed, 28 insertions, 40 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index a7eb35ca46..5b7f0edd6a 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -2284,10 +2284,10 @@ void ImportKey()
{
if(for_all_sub)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str());
}
@@ -2338,10 +2338,10 @@ void ImportKey()
{
if(for_all_sub)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
{
char *tmp = NULL;
diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp
index 9896393cbc..d730dae4b0 100644
--- a/plugins/New_GPG/src/metacontacts.cpp
+++ b/plugins/New_GPG/src/metacontacts.cpp
@@ -27,7 +27,7 @@ bool metaIsProtoMetaContacts(MCONTACT hContact)
bool metaIsDefaultSubContact(MCONTACT hContact)
{
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, db_mc_getMeta(hContact), 0) == hContact;
+ return db_mc_getDefault(db_mc_getMeta(hContact)) == hContact;
}
MCONTACT metaGetContact(MCONTACT hContact)
@@ -44,19 +44,9 @@ MCONTACT metaGetMostOnline(MCONTACT hContact)
return NULL;
}
-MCONTACT metaGetDefault(MCONTACT hContact)
+MCONTACT db_mc_getDefault(MCONTACT hContact)
{
if(metaIsProtoMetaContacts(hContact))
- return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,hContact,0);
+ return db_mc_getDefault(hContact);
return NULL;
}
-
-DWORD metaGetContactsNum(MCONTACT hContact)
-{
- return CallService(MS_MC_GETNUMCONTACTS, hContact, 0);
-}
-
-MCONTACT metaGetSubcontact(MCONTACT hContact, int num)
-{
- 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 d908d1e8a8..0819239f01 100644
--- a/plugins/New_GPG/src/metacontacts.h
+++ b/plugins/New_GPG/src/metacontacts.h
@@ -18,6 +18,4 @@ bool metaIsProtoMetaContacts(MCONTACT hContact);
bool metaIsDefaultSubContact(MCONTACT hContact) ;
MCONTACT metaGetContact(MCONTACT hContact);
MCONTACT metaGetMostOnline(MCONTACT hContact);
-MCONTACT metaGetDefault(MCONTACT hContact);
-DWORD metaGetContactsNum(MCONTACT hContact);
-MCONTACT metaGetSubcontact(MCONTACT hContact, int num);
+
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index cf05777171..dcedbd4b4e 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -263,10 +263,10 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if(MessageBox(0, TranslateT("Do you want to remove key from entire metacontact (all subcontacts)?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
MCONTACT hcnt = NULL;
- int count = metaGetContactsNum(meta);
+ int count = db_mc_getSubCount(meta);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(meta, i);
+ hcnt = db_mc_getSub(meta, i);
if(hcnt)
{
db_unset(hcnt, szGPGModuleName, "KeyID");
@@ -880,10 +880,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
if(MessageBox(0, TranslateT("Do you want to load key for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
allsubcontacts = true;
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str());
}
@@ -944,10 +944,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_unset(hcnt, szGPGModuleName, "bAlwatsTrust");
}
@@ -975,10 +975,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyID", tmp2);
}
@@ -1024,10 +1024,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str());
}
@@ -1061,10 +1061,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
}
@@ -1087,10 +1087,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
}
@@ -1116,10 +1116,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
}
@@ -1187,10 +1187,10 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
{
if(allsubcontacts)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
{
if(!isContactSecured(hcnt))
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index c20a6645de..ae46d01671 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -211,10 +211,10 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
{
if(MessageBox(0, TranslateT("Do you want to toggle encryption for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
- int count = metaGetContactsNum(hContact);
+ int count = db_mc_getSubCount(hContact);
for(int i = 0; i < count; i++)
{
- MCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = db_mc_getSub(hContact, i);
if(hcnt)
db_set_b(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1);
}