summaryrefslogtreecommitdiff
path: root/plugins/New_GPG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 20:47:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 20:47:51 +0000
commit68d3fd47bb9b75e65859d14199ffee01f16ac9a7 (patch)
treefcc340ad7067561e57733b287f193a7dbed93dd4 /plugins/New_GPG
parent7193759b046338c6f47ff2edb34743a1465791cd (diff)
HCONTACT is not needed anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG')
-rw-r--r--plugins/New_GPG/src/clist.cpp2
-rw-r--r--plugins/New_GPG/src/globals.h6
-rw-r--r--plugins/New_GPG/src/icons.cpp12
-rw-r--r--plugins/New_GPG/src/init.cpp2
-rwxr-xr-xplugins/New_GPG/src/main.cpp14
-rw-r--r--plugins/New_GPG/src/main.h2
-rwxr-xr-xplugins/New_GPG/src/messages.cpp12
-rw-r--r--plugins/New_GPG/src/metacontacts.cpp26
-rw-r--r--plugins/New_GPG/src/metacontacts.h16
-rwxr-xr-xplugins/New_GPG/src/options.cpp42
-rw-r--r--plugins/New_GPG/src/srmm.cpp8
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp50
-rw-r--r--plugins/New_GPG/src/utilities.h16
13 files changed, 104 insertions, 104 deletions
diff --git a/plugins/New_GPG/src/clist.cpp b/plugins/New_GPG/src/clist.cpp
index 9a2322023d..1cd6088b9c 100644
--- a/plugins/New_GPG/src/clist.cpp
+++ b/plugins/New_GPG/src/clist.cpp
@@ -26,6 +26,6 @@ int onExtraImageListRebuilding(WPARAM, LPARAM)
int onExtraImageApplying(WPARAM wParam, LPARAM)
{
- setClistIcon((HCONTACT)wParam);
+ setClistIcon((MCONTACT)wParam);
return 0;
}
diff --git a/plugins/New_GPG/src/globals.h b/plugins/New_GPG/src/globals.h
index 744bcad389..a895bfd977 100644
--- a/plugins/New_GPG/src/globals.h
+++ b/plugins/New_GPG/src/globals.h
@@ -20,11 +20,11 @@ extern bool bAppendTags, bPresenceSigning, bStripTags, gpg_valid, gpg_keyexist,
extern TCHAR *inopentag, *inclosetag, *outopentag, *outclosetag;
extern logtofile debuglog;
-extern map<int, HCONTACT> user_data;
-extern int item_num;
+extern map<int, MCONTACT> user_data;
+extern int item_num;
extern bool _terminate;
extern wstring new_key;
-extern HCONTACT new_key_hcnt;
+extern MCONTACT new_key_hcnt;
extern boost::mutex new_key_hcnt_mutex;
#endif
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp
index 65ddc26b0a..ac41cb8788 100644
--- a/plugins/New_GPG/src/icons.cpp
+++ b/plugins/New_GPG/src/icons.cpp
@@ -44,11 +44,11 @@ HANDLE IconLibHookIconsChanged(MIRANDAHOOK hook)
return HookEvent(ME_SKIN2_ICONSCHANGED, hook);
}
-void setClistIcon(HCONTACT hContact)
+void setClistIcon(MCONTACT hContact)
{
bool enabled = isContactSecured(hContact);
extern HANDLE g_hCLIcon;
- HCONTACT hMC = hContact;
+ MCONTACT hMC = hContact;
if(metaIsSubcontact(hContact))
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
@@ -59,11 +59,11 @@ void setClistIcon(HCONTACT hContact)
ExtraIcon_SetIcon(g_hCLIcon, hMC, szIconId);
}
-void setSrmmIcon(HCONTACT h)
+void setSrmmIcon(MCONTACT h)
{
- HCONTACT hContact = metaIsProtoMetaContacts(h) ? metaGetMostOnline(h) : h;
+ MCONTACT hContact = metaIsProtoMetaContacts(h) ? metaGetMostOnline(h) : h;
bool enabled = isContactSecured(hContact);
- HCONTACT hMC = NULL;
+ MCONTACT hMC = NULL;
if(metaIsSubcontact(hContact))
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
@@ -91,7 +91,7 @@ void RefreshContactListIcons()
{
CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
setClistIcon(hContact);
CallService(MS_CLUI_LISTENDREBUILD,0,0);
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index fd21bdaf2f..185cb0d774 100644
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -31,7 +31,7 @@ XML_API xi = {0};
int hLangpack = 0;
logtofile debuglog;
bool gpg_valid = false, gpg_keyexist = false;
-std::map<HCONTACT, contact_data> hcontact_data;
+std::map<MCONTACT, contact_data> hcontact_data;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 2230a26ebd..c145fb41b0 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -1281,7 +1281,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ static MCONTACT hContact = INVALID_CONTACT_ID;
void ImportKey();
TCHAR *tmp = NULL;
switch (msg)
@@ -1314,8 +1314,8 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara
case IDC_IMPORT_AND_USE:
ImportKey();
db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1);
- void setSrmmIcon(HCONTACT hContact);
- void setClistIcon(HCONTACT hContact);
+ void setSrmmIcon(MCONTACT hContact);
+ void setClistIcon(MCONTACT hContact);
setSrmmIcon(hContact);
setClistIcon(hContact);
DestroyWindow(hwndDlg);
@@ -1899,7 +1899,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar
static INT_PTR CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ MCONTACT hContact = INVALID_CONTACT_ID;
switch (msg) {
case WM_INITDIALOG:
@@ -2274,7 +2274,7 @@ void InitCheck()
void ImportKey()
{
- HCONTACT hContact = new_key_hcnt;
+ MCONTACT hContact = new_key_hcnt;
new_key_hcnt_mutex.unlock();
bool for_all_sub = false;
if(metaIsProtoMetaContacts(hContact))
@@ -2287,7 +2287,7 @@ void ImportKey()
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str());
}
@@ -2341,7 +2341,7 @@ void ImportKey()
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
{
char *tmp = NULL;
diff --git a/plugins/New_GPG/src/main.h b/plugins/New_GPG/src/main.h
index 36a7bafb0f..309d0a5857 100644
--- a/plugins/New_GPG/src/main.h
+++ b/plugins/New_GPG/src/main.h
@@ -22,7 +22,7 @@ struct contact_data
string key_in_prescense;
};
-extern std::map<HCONTACT, contact_data> hcontact_data;
+extern std::map<MCONTACT, contact_data> hcontact_data;
extern bool bAutoExchange;
extern RECT key_from_keyserver_rect, firstrun_rect, new_key_rect, key_gen_rect, load_key_rect, import_key_rect, key_password_rect, load_existing_key_rect;
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index 5638a297c4..70ce62ddf5 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -18,14 +18,14 @@
wstring new_key;
-HCONTACT new_key_hcnt = NULL;
+MCONTACT new_key_hcnt = NULL;
boost::mutex new_key_hcnt_mutex;
bool _terminate = false;
-int returnNoError(HCONTACT hContact);
+int returnNoError(MCONTACT hContact);
std::list<HANDLE> sent_msgs;
-void RecvMsgSvc_func(HCONTACT hContact, std::wstring str, char *msg, DWORD flags, DWORD timestamp)
+void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags, DWORD timestamp)
{
DWORD dbflags = DBEF_UTF;
{ //check for gpg related data
@@ -598,7 +598,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
return 0;
}
-void SendMsgSvc_func(HCONTACT hContact, char *msg, DWORD flags)
+void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags)
{
bool isansi = false;
DWORD dbflags = 0;
@@ -838,7 +838,7 @@ int HookSendMsg(WPARAM w, LPARAM l)
DBEVENTINFO * dbei = (DBEVENTINFO*)l;
if(dbei->eventType != EVENTTYPE_MESSAGE)
return 0;
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
if(dbei->flags & DBEF_SENT)
{
if(isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.t.c.
@@ -986,7 +986,7 @@ int HookSendMsg(WPARAM w, LPARAM l)
debuglog<<std::string(time_str()+": event message: \""+(char*)dbei->pBlob+"\" passed event filter, contact "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR))+" is unsecured");
return 0;
}
- if(!(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((HCONTACT)w))
+ if(!(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((MCONTACT)w))
{
char tmp[29];
strncpy(tmp, (char*)dbei->pBlob, 27);
diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp
index 27c6963213..31b320737c 100644
--- a/plugins/New_GPG/src/metacontacts.cpp
+++ b/plugins/New_GPG/src/metacontacts.cpp
@@ -18,7 +18,7 @@
extern bool bMetaContacts;
-bool metaIsProtoMetaContacts(HCONTACT hContact)
+bool metaIsProtoMetaContacts(MCONTACT hContact)
{
if(bMetaContacts) {
LPSTR proto = GetContactProto(hContact);
@@ -29,54 +29,54 @@ bool metaIsProtoMetaContacts(HCONTACT hContact)
return false;
}
-bool metaIsDefaultSubContact(HCONTACT hContact)
+bool metaIsDefaultSubContact(MCONTACT hContact)
{
if(bMetaContacts)
- return (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
+ return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
return false;
}
-HCONTACT metaGetContact(HCONTACT hContact)
+MCONTACT metaGetContact(MCONTACT hContact)
{
if(bMetaContacts)
if(metaIsSubcontact(hContact))
- return (HCONTACT)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
+ return (MCONTACT)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
return NULL;
}
-bool metaIsSubcontact(HCONTACT hContact)
+bool metaIsSubcontact(MCONTACT hContact)
{
if(bMetaContacts)
return CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0) != 0;
return false;
}
-HCONTACT metaGetMostOnline(HCONTACT hContact)
+MCONTACT metaGetMostOnline(MCONTACT hContact)
{
if(bMetaContacts)
if(metaIsProtoMetaContacts(hContact))
- return (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0);
+ return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0);
return NULL;
}
-HCONTACT metaGetDefault(HCONTACT hContact)
+MCONTACT metaGetDefault(MCONTACT hContact)
{
if(bMetaContacts)
if(metaIsProtoMetaContacts(hContact))
- return (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)hContact,0);
+ return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)hContact,0);
return NULL;
}
-DWORD metaGetContactsNum(HCONTACT hContact)
+DWORD metaGetContactsNum(MCONTACT hContact)
{
if(bMetaContacts)
return CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0);
return 0;
}
-HCONTACT metaGetSubcontact(HCONTACT hContact, int num)
+MCONTACT metaGetSubcontact(MCONTACT hContact, int num)
{
if(bMetaContacts)
- return (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)num);
+ return (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)num);
return 0;
}
diff --git a/plugins/New_GPG/src/metacontacts.h b/plugins/New_GPG/src/metacontacts.h
index 9dba2943c0..396c3bcb43 100644
--- a/plugins/New_GPG/src/metacontacts.h
+++ b/plugins/New_GPG/src/metacontacts.h
@@ -14,11 +14,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-bool metaIsProtoMetaContacts(HCONTACT hContact);
-bool metaIsDefaultSubContact(HCONTACT hContact) ;
-HCONTACT metaGetContact(HCONTACT hContact);
-bool metaIsSubcontact(HCONTACT hContact);
-HCONTACT metaGetMostOnline(HCONTACT hContact);
-HCONTACT metaGetDefault(HCONTACT hContact);
-DWORD metaGetContactsNum(HCONTACT hContact);
-HCONTACT metaGetSubcontact(HCONTACT hContact, int num);
+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);
+MCONTACT metaGetSubcontact(MCONTACT hContact, int num);
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 3f43a4e9fd..019036e6ce 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -66,7 +66,7 @@ int GpgOptInit(WPARAM wParam,LPARAM lParam)
return 0;
}
-map<int, HCONTACT> user_data;
+map<int, MCONTACT> user_data;
int item_num = 0;
HWND hwndList_p = NULL;
@@ -120,7 +120,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ListView_InsertColumn(hwndList, 4, &col);
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
int i = 1, iRow = 0;
- for(HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
+ for(MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
if(isContactHaveKey(hContact)) {
TCHAR *name = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
item.mask = LVIF_TEXT;
@@ -192,16 +192,16 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (LOWORD(wParam))
{
case IDC_DELETE_KEY_BUTTON:
- void setClistIcon(HCONTACT hContact);
- void setSrmmIcon(HCONTACT hContact);
+ void setClistIcon(MCONTACT hContact);
+ void setSrmmIcon(MCONTACT hContact);
{ //gpg execute block
TCHAR tmp2[MAX_PATH] = {0};
TCHAR *ptmp;
char *tmp;
bool keep = false;
bool ismetacontact = false;
- HCONTACT meta = NULL;
- HCONTACT hContact = user_data[item_num+1];
+ MCONTACT meta = NULL;
+ MCONTACT hContact = user_data[item_num+1];
if(metaIsProtoMetaContacts(hContact))
{
meta = hContact;
@@ -214,7 +214,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ismetacontact = true;
}
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
- for(HCONTACT hcnttmp = db_find_first(); hcnttmp != NULL; hcnttmp = db_find_next(hcnttmp)) {
+ for(MCONTACT hcnttmp = db_find_first(); hcnttmp != NULL; hcnttmp = db_find_next(hcnttmp)) {
if(hcnttmp != hContact) {
char *tmp2 = UniGetContactSettingUtf(hcnttmp, szGPGModuleName, "KeyID", "");
if(!strcmp(tmp, tmp2)) {
@@ -262,7 +262,7 @@ 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)
{
- HCONTACT hcnt = NULL;
+ MCONTACT hcnt = NULL;
int count = metaGetContactsNum(meta);
for(int i = 0; i < count; i++)
{
@@ -407,8 +407,8 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
else if(hdr->hdr.code == LVN_ITEMCHANGED)
{
- void setClistIcon(HCONTACT hContact);
- void setSrmmIcon(HCONTACT hContact);
+ void setClistIcon(MCONTACT hContact);
+ void setSrmmIcon(MCONTACT hContact);
if(ListView_GetCheckState(hwndList, item_num))
db_set_b(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 1);
else
@@ -719,7 +719,7 @@ static LRESULT CALLBACK editctrl_ctrl_a(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
- static HCONTACT hContact;
+ static MCONTACT hContact;
TCHAR *tmp = NULL;
wstring key_buf;
wstring::size_type ws1 = 0, ws2 = 0;
@@ -729,7 +729,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
hContact = user_data[1];
SetWindowPos(hwndDlg, 0, load_key_rect.left, load_key_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PUBLIC_KEY_EDIT), editctrl_ctrl_a);
- HCONTACT hcnt = hContact;
+ MCONTACT hcnt = hContact;
if(metaIsProtoMetaContacts(hcnt))
hcnt = metaGetMostOnline(hcnt);
TranslateDialogDefault(hwndDlg);
@@ -883,7 +883,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str());
}
@@ -903,7 +903,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
string output;
DWORD exitcode;
{
- HCONTACT hcnt = hContact;
+ MCONTACT hcnt = hContact;
if(metaIsProtoMetaContacts(hcnt))
hcnt = metaGetMostOnline(hcnt);
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
@@ -947,7 +947,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_unset(hcnt, szGPGModuleName, "bAlwatsTrust");
}
@@ -978,7 +978,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyID", tmp2);
}
@@ -1027,7 +1027,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str());
}
@@ -1064,7 +1064,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
}
@@ -1090,7 +1090,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
}
@@ -1119,7 +1119,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
}
@@ -1190,7 +1190,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
{
if(!isContactSecured(hcnt))
diff --git a/plugins/New_GPG/src/srmm.cpp b/plugins/New_GPG/src/srmm.cpp
index 542312213d..154ff32c3d 100644
--- a/plugins/New_GPG/src/srmm.cpp
+++ b/plugins/New_GPG/src/srmm.cpp
@@ -18,8 +18,8 @@
#include "commonheaders.h"
-void ShowStatusIcon(HCONTACT hContact);
-void setSrmmIcon(HCONTACT hContact);
+void ShowStatusIcon(MCONTACT hContact);
+void setSrmmIcon(MCONTACT hContact);
int __cdecl onWindowEvent(WPARAM wParam, LPARAM lParam) {
@@ -34,8 +34,8 @@ int __cdecl onWindowEvent(WPARAM wParam, LPARAM lParam) {
int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
- HCONTACT hMeta = NULL;
+ MCONTACT hContact = (MCONTACT)wParam;
+ MCONTACT hMeta = NULL;
if(metaIsProtoMetaContacts(hContact))
{
hMeta = hContact;
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 1170542944..c2d1be1b0f 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -18,7 +18,7 @@
#include "commonheaders.h"
-TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef)
+TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef)
{
DBVARIANT dbv = {DBVT_DELETED};
TCHAR* szRes = NULL;
@@ -33,7 +33,7 @@ TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule
return szRes;
}
-char* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, char* szDef)
+char* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, char* szDef)
{
DBVARIANT dbv = {DBVT_DELETED};
char* szRes = NULL;
@@ -138,14 +138,14 @@ void GetFolderPath(TCHAR *WindowTittle, char *szSetting)
INT_PTR LoadKey(WPARAM w, LPARAM l)
{
void ShowLoadPublicKeyDialog();
- user_data[1] = (HCONTACT)w;
+ user_data[1] = (MCONTACT)w;
ShowLoadPublicKeyDialog();
return 0;
}
INT_PTR SendKey(WPARAM w, LPARAM l)
{
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
if(metaIsProtoMetaContacts(hContact))
hContact = metaGetMostOnline(hContact);
char *szMessage;
@@ -201,7 +201,7 @@ extern HGENMENU hToggleEncryption, hSendKey;
INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
{
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
BYTE enc = 0;
if(metaIsProtoMetaContacts(hContact))
enc = db_get_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0);
@@ -214,7 +214,7 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- HCONTACT hcnt = metaGetSubcontact(hContact, i);
+ MCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_b(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1);
}
@@ -223,8 +223,8 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
}
else
db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc?0:1);
- void setSrmmIcon(HCONTACT hContact);
- void setClistIcon(HCONTACT hContact);
+ void setSrmmIcon(MCONTACT hContact);
+ void setClistIcon(MCONTACT hContact);
setSrmmIcon(hContact);
setClistIcon(hContact);
enc = enc?0:1;
@@ -237,7 +237,7 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l)
int OnPreBuildContactMenu(WPARAM w, LPARAM l)
{
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
if(metaIsProtoMetaContacts(hContact))
hContact = metaGetMostOnline(hContact);
@@ -473,12 +473,12 @@ int onProtoAck(WPARAM w, LPARAM l)
return 0;
}
-std::wstring encrypt_file(HCONTACT hContact, TCHAR *filename)
+std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename)
{
string out;
DWORD code;
pxResult result;
- HCONTACT hcnt = metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact;
+ MCONTACT hcnt = metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact;
std::vector<wstring> cmd;
cmd.push_back(L"--batch");
cmd.push_back(L"--tes");
@@ -638,7 +638,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l)
}
-void HistoryLog(HCONTACT hContact, db_event evt)
+void HistoryLog(MCONTACT hContact, db_event evt)
{
DBEVENTINFO Event = { sizeof(Event) };
Event.szModule = szGPGModuleName;
@@ -719,7 +719,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
LPCTSTR attr = xi.getAttrValue(local_node, _T("to"));
if(attr)
{
- HCONTACT hContact = ji->ContactFromJID(attr);
+ MCONTACT hContact = ji->ContactFromJID(attr);
if(hContact)
if(!isContactSecured(hContact))
return FALSE;
@@ -1009,7 +1009,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
string::size_type p2 = out.find("\n", p1);
if(p1 != string::npos && p2 != string::npos)
{
- HCONTACT hContact = NULL;
+ MCONTACT hContact = NULL;
{
extern list <JabberAccount*> Accounts;
list <JabberAccount*>::iterator p = Accounts.begin();
@@ -1070,7 +1070,7 @@ void AddHandlers()
}
}
-bool isContactSecured(HCONTACT hContact)
+bool isContactSecured(MCONTACT hContact)
{
BYTE gpg_enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
if(!gpg_enc)
@@ -1096,7 +1096,7 @@ bool isContactSecured(HCONTACT hContact)
return true;
}
-bool isContactHaveKey(HCONTACT hContact)
+bool isContactHaveKey(MCONTACT hContact)
{
TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T(""));
if(_tcslen(key) > 0)
@@ -1215,7 +1215,7 @@ const bool StriStr(const char *str, const char *substr)
return i;
}
-bool IsOnline(HCONTACT hContact)
+bool IsOnline(MCONTACT hContact)
{
if(db_get_b(hContact, szGPGModuleName, "Status", 0) == ID_STATUS_OFFLINE)
return false;
@@ -1226,7 +1226,7 @@ bool IsOnline(HCONTACT hContact)
#include <process.h>
struct TFakeAckParams {
- inline TFakeAckParams( HANDLE p1, HCONTACT p2, LONG p3, LPCSTR p4 ) :
+ inline TFakeAckParams( HANDLE p1, MCONTACT p2, LONG p3, LPCSTR p4 ) :
hEvent( p1 ),
hContact( p2 ),
id( p3 ),
@@ -1234,12 +1234,12 @@ struct TFakeAckParams {
{}
HANDLE hEvent;
- HCONTACT hContact;
+ MCONTACT hContact;
LONG id;
LPCSTR msg;
};
-__forceinline int SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
+__forceinline int SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
return ProtoBroadcastAck( GetContactProto(hContact), hContact, type, result, hProcess, lParam);
}
@@ -1262,7 +1262,7 @@ unsigned __stdcall sttFakeAck( LPVOID param )
}
-int returnNoError(HCONTACT hContact) {
+int returnNoError(MCONTACT hContact) {
HANDLE hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
unsigned int tID;
CloseHandle( (HANDLE) _beginthreadex(NULL, 0, sttFakeAck, new TFakeAckParams(hEvent,hContact,777,0), 0, &tID) );
@@ -1320,7 +1320,7 @@ string get_random(int length)
void send_encrypted_msgs_thread(void *param)
{
- HCONTACT hContact = (HCONTACT)param;
+ MCONTACT hContact = (MCONTACT)param;
while(true)
{
//char *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", "");
@@ -1394,7 +1394,7 @@ void ExportGpGKeysFunc(int type)
if(!file.is_open())
return; //TODO: handle error
if(!type || type == 2) {
- for(HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for(MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *k = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", "");
std::string key;
if(!k[0])
@@ -1681,7 +1681,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
if(acc.length())
{
const char * uid = (const char*)CallProtoService(acc.c_str(), PS_GETCAPS, (WPARAM)PFLAG_UNIQUEIDSETTING, 0);
- for(HCONTACT hContact = db_find_first(acc.c_str()); hContact; hContact = db_find_next(hContact, acc.c_str())) {
+ for(MCONTACT hContact = db_find_first(acc.c_str()); hContact; hContact = db_find_next(hContact, acc.c_str())) {
DBVARIANT dbv = {0};
db_get(hContact, acc.c_str(), uid, &dbv);
std::string id;
@@ -1754,7 +1754,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
string output;
DWORD exitcode;
{
- HCONTACT hcnt = hContact;
+ MCONTACT hcnt = hContact;
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
path = ptmp;
mir_free(ptmp);
diff --git a/plugins/New_GPG/src/utilities.h b/plugins/New_GPG/src/utilities.h
index 3b884a3846..32a99ea716 100644
--- a/plugins/New_GPG/src/utilities.h
+++ b/plugins/New_GPG/src/utilities.h
@@ -16,22 +16,22 @@
#ifndef UTILITIES_H
#define UTILITIES_H
-TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
-char* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, char* szDef);
+TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
+char* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, char* szDef);
void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szExtDesc);
TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file = false);
void GetFolderPath(TCHAR *WindowTittle, char *szSetting);
void storeOutput(HANDLE ahandle, string *output);
-void setSrmmIcon(HCONTACT);
-void setClistIcon(HCONTACT);
+void setSrmmIcon(MCONTACT);
+void setClistIcon(MCONTACT);
-void send_encrypted_msgs_thread(void*);
+void send_encrypted_msgs_thread(void*);
int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data);
-bool isContactSecured(HCONTACT hContact);
-bool isContactHaveKey(HCONTACT hContact);
+bool isContactSecured(MCONTACT hContact);
+bool isContactHaveKey(MCONTACT hContact);
bool isTabsrmmUsed();
bool isGPGKeyExist();
bool isGPGValid();
@@ -104,7 +104,7 @@ public:
cbSize = 0;
}
};
-void HistoryLog(HCONTACT, db_event);
+void HistoryLog(MCONTACT, db_event);
void fix_line_term(std::string &s);
void fix_line_term(std::wstring &s);
void strip_line_term(std::wstring &s);