diff options
Diffstat (limited to 'plugins/MirOTR/MirOTR/src')
-rw-r--r-- | plugins/MirOTR/MirOTR/src/dbfilter.cpp | 22 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/dialogs.cpp | 52 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/dllmain.cpp | 2 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/mirotrmenu.cpp | 8 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/mirotrmenu.h | 2 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/options.cpp | 16 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/options.h | 2 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/otr.cpp | 52 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/svcs_menu.cpp | 30 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/svcs_srmm.cpp | 10 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/svcs_srmm.h | 2 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/utils.cpp | 34 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/utils.h | 24 |
13 files changed, 128 insertions, 128 deletions
diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp index b8e6319291..787164e6f0 100644 --- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp @@ -7,7 +7,7 @@ static UINT_PTR timerId = 0; struct DeleteEventNode {
DeleteEventNode *next;
time_t timestamp;
- HCONTACT hContact;
+ MCONTACT hContact;
HANDLE hDbEvent;
};
struct DeleteEventHead {
@@ -45,7 +45,7 @@ VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi // add prefix to sent messages
int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
if (!options.prefix_messages || !lParam) return 0;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
DBEVENTINFO *dbei = (DBEVENTINFO *)lParam;
if ((dbei->eventType != EVENTTYPE_MESSAGE) || !(dbei->flags & DBEF_SENT) || (dbei->flags & DBEF_OTR_PREFIXED))
return 0;
@@ -58,7 +58,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { return 0;
if(g_metaproto && strcmp(proto, g_metaproto) == 0) {
- hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (!hContact) return 0;
proto = contact_get_proto(hContact);
if (!proto ) return 0;
@@ -191,8 +191,8 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { info.pBlob = (PBYTE)mir_alloc(info.cbBlob);
if (!db_event_get((HANDLE)lParam, &info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
- HCONTACT hContact = (HCONTACT)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ MCONTACT hContact = (MCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
@@ -223,7 +223,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { return 0;
}
-void FinishSession(HCONTACT hContact) {
+void FinishSession(MCONTACT hContact) {
if (!hContact) return;
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
TrustLevel level = otr_context_get_trust(context);
@@ -247,8 +247,8 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) { if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
- HCONTACT hContact = mwd->hContact, hTemp;
- if(options.bHaveMetaContacts && (hTemp = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ MCONTACT hContact = mwd->hContact, hTemp;
+ if(options.bHaveMetaContacts && (hTemp = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hTemp;
if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
@@ -271,14 +271,14 @@ int StatusModeChange(WPARAM wParam, LPARAM lParam) { if(status != ID_STATUS_OFFLINE ) return 0;
const char *proto = (char *)lParam;
- HCONTACT hContact;
+ MCONTACT hContact;
lib_cs_lock();
ConnContext *context = otr_user_state->context_root;
while(context) {
if(context->msgstate == OTRL_MSGSTATE_ENCRYPTED && (proto == 0 || strcmp(proto, context->protocol) == 0)) {
- hContact = (HCONTACT)context->app_data;
+ hContact = (MCONTACT)context->app_data;
if(hContact) {
otrl_message_disconnect(otr_user_state, &ops, (void*)hContact, context->accountname, context->protocol, context->username);
@@ -296,7 +296,7 @@ int StatusModeChange(WPARAM wParam, LPARAM lParam) { int OnContactSettingChanged(WPARAM wParam, LPARAM lParam) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
if (!lParam || strcmp(cws->szSetting, "Status") != 0) return 0;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
int status=0;
switch (cws->value.type){
case DBVT_WORD:
diff --git a/plugins/MirOTR/MirOTR/src/dialogs.cpp b/plugins/MirOTR/MirOTR/src/dialogs.cpp index b248ec0102..feb94572be 100644 --- a/plugins/MirOTR/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/MirOTR/src/dialogs.cpp @@ -33,8 +33,8 @@ INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM smp_for_contact[context->app_data].responder = data->responder;
mir_free(data);
- TCHAR title[512], *proto = mir_a2t(contact_get_proto((HCONTACT)context->app_data));
- const TCHAR *name =contact_get_nameT((HCONTACT)context->app_data);
+ TCHAR title[512], *proto = mir_a2t(contact_get_proto((MCONTACT)context->app_data));
+ const TCHAR *name =contact_get_nameT((MCONTACT)context->app_data);
mir_sntprintf(title, 512, TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
mir_sntprintf(title, 512, TranslateT(LANG_SMP_PROGRESS_DESC), name, proto);
@@ -168,15 +168,15 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA smp_for_contact[context->app_data].oldlevel = data->oldlevel;
smp_for_contact[context->app_data].responder = data->responder;
- TCHAR buff[512], *proto = mir_a2t(contact_get_proto((HCONTACT)context->app_data));
- mir_sntprintf(buff, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((HCONTACT)context->app_data), proto);
+ TCHAR buff[512], *proto = mir_a2t(contact_get_proto((MCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((MCONTACT)context->app_data), proto);
mir_free(proto);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)buff);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context);
if (data->question) {
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_free(data->question);
} else {
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -315,8 +315,8 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return FALSE;
}
- TCHAR title[512], *proto = mir_a2t(contact_get_proto((HCONTACT)context->app_data));
- mir_sntprintf(title, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((HCONTACT)context->app_data), proto);
+ TCHAR title[512], *proto = mir_a2t(contact_get_proto((MCONTACT)context->app_data));
+ mir_sntprintf(title, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((MCONTACT)context->app_data), proto);
mir_free(proto);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title);
@@ -370,9 +370,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
TCHAR buff[1024];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((MCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -408,7 +408,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
TCHAR msg[512];
- mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((MCONTACT)context->app_data));
ShowError(msg);
}else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, WM_GETTEXTLENGTH, 0, 0);
@@ -432,7 +432,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }else if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
TCHAR msg[512];
- mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((MCONTACT)context->app_data));
ShowError(msg);
}else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0);
@@ -477,9 +477,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255);
if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) {
if (trusted)
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((MCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -497,9 +497,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
} else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) {
if (trusted)
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT((MCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -517,9 +517,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
} else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_FINGERPRINT), 255)==0) {
if (trusted)
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((MCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -662,9 +662,9 @@ INT_PTR CALLBACK DlgProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM wParam, LPA }
TCHAR buff[512];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((MCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((MCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -729,20 +729,20 @@ unsigned int CALLBACK verify_context_thread(void *param) otrl_context_set_trust(context->active_fingerprint, "verified");
otrl_privkey_write_fingerprints(otr_user_state, g_fingerprint_store_filename);
lib_cs_unlock();
- mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT((MCONTACT)context->app_data));
msg[1023] = '\0';
- ShowMessage((HCONTACT)context->app_data, msg);
- SetEncryptionStatus((HCONTACT)context->app_data, otr_context_get_trust(context));
+ ShowMessage((MCONTACT)context->app_data, msg);
+ SetEncryptionStatus((MCONTACT)context->app_data, otr_context_get_trust(context));
break;
case IDNO:
lib_cs_lock();
otrl_context_set_trust(context->active_fingerprint, NULL);
otrl_privkey_write_fingerprints(otr_user_state, g_fingerprint_store_filename);
lib_cs_unlock();
- mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((MCONTACT)context->app_data));
msg[1023] = '\0';
- ShowMessage((HCONTACT)context->app_data, msg);
- SetEncryptionStatus((HCONTACT)context->app_data, otr_context_get_trust(context));
+ ShowMessage((MCONTACT)context->app_data, msg);
+ SetEncryptionStatus((MCONTACT)context->app_data, otr_context_get_trust(context));
break;
}
}
diff --git a/plugins/MirOTR/MirOTR/src/dllmain.cpp b/plugins/MirOTR/MirOTR/src/dllmain.cpp index 1c275c4e92..22973c7676 100644 --- a/plugins/MirOTR/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/MirOTR/src/dllmain.cpp @@ -88,7 +88,7 @@ extern "C" __declspec(dllexport) int Load(void) // remove us as a filter to all contacts - fix filter type problem
if(db_get_b(0, MODULENAME, "FilterOrderFix", 0) != 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))
CallService(MS_PROTO_REMOVEFROMCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME);
db_set_b(0, MODULENAME, "FilterOrderFix", 2);
}
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp index 78fd4bf165..35ecb94435 100644 --- a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp @@ -49,7 +49,7 @@ static INT_PTR AddMirOTRMenuItem(WPARAM, LPARAM lParam) static INT_PTR BuildMirOTRMenu(WPARAM wParam, LPARAM)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
ListParam param = { 0 };
param.MenuObjectHandle = hMirOTRMenuObject;
@@ -87,8 +87,8 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam,LPARAM) if ( cmep == NULL ) //this is rootsection...build it
return TRUE;
- HCONTACT hContact = (HCONTACT)pcpp->wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ MCONTACT hContact = (MCONTACT)pcpp->wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
TrustLevel level = ( TrustLevel )otr_context_get_trust(otrl_context_find_miranda(otr_user_state, hContact));
@@ -178,7 +178,7 @@ LRESULT CALLBACK PopupMenuWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM return DefWindowProc(hwnd, message, wParam, lParam);
}
-void ShowOTRMenu(HCONTACT hContact, POINT pt){
+void ShowOTRMenu(MCONTACT hContact, POINT pt){
HMENU menu = (HMENU) CallService(MS_MIROTR_MENUBUILDMIROTR, (WPARAM)hContact, 0);
SetWindowLongPtr(hDummyPaintWin, GWLP_USERDATA, (LONG_PTR)hContact);
TrackPopupMenu(menu, 0, pt.x, pt.y, 0, hDummyPaintWin, 0);
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.h b/plugins/MirOTR/MirOTR/src/mirotrmenu.h index c92adab7fb..e57e954745 100644 --- a/plugins/MirOTR/MirOTR/src/mirotrmenu.h +++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.h @@ -42,4 +42,4 @@ typedef struct { void InitMirOTRMenu(void);
void UninitMirOTRMenu(void);
-void ShowOTRMenu(HCONTACT hContact, POINT pt);
+void ShowOTRMenu(MCONTACT hContact, POINT pt);
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp index a3645f52c7..f090d9b474 100644 --- a/plugins/MirOTR/MirOTR/src/options.cpp +++ b/plugins/MirOTR/MirOTR/src/options.cpp @@ -158,7 +158,7 @@ void SaveOptions() { extern "C" void set_context_contact(void *data, ConnContext *context)
{
- HCONTACT hContact = find_contact(context->username, context->protocol);
+ MCONTACT hContact = find_contact(context->username, context->protocol);
context->app_data = (void*)hContact;
}
@@ -557,7 +557,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM const char *proto;
TCHAR *proto_t;
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
proto = contact_get_proto(hContact);
if(proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME) // ignore chatrooms
&& (g_metaproto == 0 || strcmp(proto, g_metaproto) != 0)) // and MetaContacts
@@ -586,7 +586,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM switch ( LOWORD( wParam )) {
case IDC_CMB_CONT_POLICY:
{
- HCONTACT hContact = 0;
+ MCONTACT hContact = 0;
int iUser = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS));
if (iUser == -1) break;
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_GETCURSEL, 0, 0);
@@ -604,7 +604,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvi.iSubItem = 0;
ListView_GetItem(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS), &lvi);
ContactPolicyMap* cpm = (ContactPolicyMap*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- hContact = (HCONTACT)lvi.lParam;
+ hContact = (MCONTACT)lvi.lParam;
(*cpm)[hContact].policy = policy;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}break;
@@ -650,7 +650,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvi.iSubItem = 0;
SendDlgItemMessage(hwndDlg, IDC_LV_CONT_CONTACTS, LVM_GETITEM, 0, (LPARAM)&lvi);
- HCONTACT hContact = (HCONTACT)lvi.lParam;
+ MCONTACT hContact = (MCONTACT)lvi.lParam;
ContactPolicyMap *cp = (ContactPolicyMap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCHAR buff[50];
ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, 50);
@@ -743,7 +743,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w Fingerprint *fp;
while (context) {
if (context->app_data) {
- user = (TCHAR*)contact_get_nameT((HCONTACT)context->app_data);
+ user = (TCHAR*)contact_get_nameT((MCONTACT)context->app_data);
if (user) {
proto = mir_a2t(context->protocol);
fp = context->fingerprint_root.next;
@@ -819,7 +819,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w if (fp->context->active_fingerprint == fp) {
TCHAR buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, fp->fingerprint);
- mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT((HCONTACT)fp->context->app_data));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT((MCONTACT)fp->context->app_data));
ShowError(buff);
} else {
FPModifyMap* fpm = (FPModifyMap*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -848,7 +848,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w if (it->first->context->active_fingerprint == it->first) {
TCHAR buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, it->first->fingerprint);
- mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT((HCONTACT)it->first->context->app_data));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT((MCONTACT)it->first->context->app_data));
ShowError(buff);
} else {
otrl_context_forget_fingerprint(it->first, 1);
diff --git a/plugins/MirOTR/MirOTR/src/options.h b/plugins/MirOTR/MirOTR/src/options.h index a2c39a5e93..ee74c7b9cc 100644 --- a/plugins/MirOTR/MirOTR/src/options.h +++ b/plugins/MirOTR/MirOTR/src/options.h @@ -51,7 +51,7 @@ struct CONTACT_DATA { OtrlPolicy policy;
int htmlconv;
};
-typedef std::map<HCONTACT, CONTACT_DATA> ContactPolicyMap;
+typedef std::map<MCONTACT, CONTACT_DATA> ContactPolicyMap;
typedef enum {FPM_VERIFY, FPM_NOTRUST, FPM_DELETE } FPModify;
typedef std::map<Fingerprint*, FPModify> FPModifyMap;
diff --git a/plugins/MirOTR/MirOTR/src/otr.cpp b/plugins/MirOTR/MirOTR/src/otr.cpp index dfc22f5e70..04c7446636 100644 --- a/plugins/MirOTR/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/MirOTR/src/otr.cpp @@ -76,7 +76,7 @@ extern "C" { /* Return the OTR policy for the given context. */
OtrlPolicy otr_gui_policy(void *opdata, ConnContext *context) {
DEBUGOUT_T("OTR_GUI_POLICY")
- HCONTACT hContact = (HCONTACT)opdata;
+ MCONTACT hContact = (MCONTACT)opdata;
DWORD pol;
if(hContact) {
pol = db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
@@ -110,7 +110,7 @@ extern "C" { //DWORD tid;
//CloseHandle(CreateThread(0, 0, newKeyThread, (VOID *)nkd, 0, &tid));
//QueueUserAPC(newKeyAPC, Global::mainThread, (DWORD)nkd);
- if (opdata) protocol = contact_get_proto((HCONTACT)opdata);
+ if (opdata) protocol = contact_get_proto((MCONTACT)opdata);
if (!protocol) return;
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_GENKEYNOTIFY), 0, GenKeyDlgFunc, (LPARAM)protocol );
@@ -124,7 +124,7 @@ extern "C" { * logged in" errors if you're wrong. */
int otr_gui_is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient) {
DEBUGOUT_T("OTR_GUI_IS_LOGGED_IN")
- HCONTACT hContact = (HCONTACT)opdata;
+ MCONTACT hContact = (MCONTACT)opdata;
if(hContact) {
WORD status = db_get_w(hContact, contact_get_proto(hContact), "Status", ID_STATUS_OFFLINE);
if(status == ID_STATUS_OFFLINE) return 0;
@@ -139,7 +139,7 @@ extern "C" { void otr_gui_inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) {
DEBUGOUT_T("OTR_GUI_INJECT_MESSAGE")
//MessageBox(0, message, "OTR Inject", MB_OK);
- HCONTACT hContact = (HCONTACT)opdata;
+ MCONTACT hContact = (MCONTACT)opdata;
if(protocol && db_get_w(hContact, protocol, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
CallContactService(hContact, PSS_MESSAGE, PREF_UTF|PREF_BYPASS_OTR, (LPARAM)message);
@@ -149,7 +149,7 @@ extern "C" { * protocol / username conversation. */
void otr_gui_notify(void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary) {
DEBUGOUT_T("OTR_GUI_NOTIFY")
- const TCHAR* uname = contact_get_nameT((HCONTACT)opdata);
+ const TCHAR* uname = contact_get_nameT((MCONTACT)opdata);
TCHAR* title_t = mir_utf8decodeT(title);
TCHAR *notify = TranslateT(LANG_OTR_NOTIFY);
@@ -180,11 +180,11 @@ extern "C" { int otr_gui_display_otr_message(void *opdata, const char *accountname, const char *protocol, const char *username, const char *msg) {
DEBUGOUT_T("OTR_GUI_DISPLAY_OTR_MESSAGE")
if(options.msg_inline)
- ShowMessageInlineUtf((HCONTACT)opdata, Translate(msg));
+ ShowMessageInlineUtf((MCONTACT)opdata, Translate(msg));
if(options.msg_popup) {
TCHAR buff[512];
TCHAR* proto = mir_a2t(protocol);
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_USERMESSAGE), contact_get_nameT((HCONTACT)opdata), proto);
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_USERMESSAGE), contact_get_nameT((MCONTACT)opdata), proto);
mir_free(proto);
TCHAR *msg_t = mir_utf8decodeT(msg);
ShowPopup(buff, TranslateTS(msg_t), 0);
@@ -237,18 +237,18 @@ extern "C" { DEBUGOUT_T("OTR_GUI_GONE_SECURE")
TrustLevel trusted = otr_context_get_trust(context);
// opdata is hContact
- SetEncryptionStatus((HCONTACT)opdata, trusted);
+ SetEncryptionStatus((MCONTACT)opdata, trusted);
TCHAR buff[1024];
if(trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT((MCONTACT)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT((MCONTACT)opdata));
} else { // should never happen
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((MCONTACT)opdata));
}
// opdata is hContact
- ShowMessage((HCONTACT)opdata, buff);
+ ShowMessage((MCONTACT)opdata, buff);
}
@@ -256,14 +256,14 @@ extern "C" { void otr_gui_gone_insecure(void *opdata, ConnContext *context) {
DEBUGOUT_T("OTR_GUI_GONE_INSECURE")
TCHAR buff[512];
- mir_sntprintf(buff, 512, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 512, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT((MCONTACT)opdata));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
if (!Miranda_Terminated()) {
- ShowMessage((HCONTACT)opdata, buff);
+ ShowMessage((MCONTACT)opdata, buff);
}
// opdata is hContact
- SetEncryptionStatus((HCONTACT)opdata, otr_context_get_trust(context));
+ SetEncryptionStatus((MCONTACT)opdata, otr_context_get_trust(context));
}
/* We have completed an authentication, using the D-H keys we
@@ -271,36 +271,36 @@ extern "C" { void otr_gui_still_secure(void *opdata, ConnContext *context, int is_reply) {
DEBUGOUT_T("OTR_GUI_STILL_SECURE")
TrustLevel trusted = otr_context_get_trust(context);
- SetEncryptionStatus((HCONTACT)opdata, trusted);
+ SetEncryptionStatus((MCONTACT)opdata, trusted);
TCHAR buff[1024];
if (!is_reply) {
if(trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT((MCONTACT)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT((MCONTACT)opdata));
} else { // should never happen
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((MCONTACT)opdata));
}
// opdata is hContact
- ShowMessage((HCONTACT)opdata, buff);
+ ShowMessage((MCONTACT)opdata, buff);
} else {
if(trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT((MCONTACT)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT((MCONTACT)opdata));
} else { // should never happen
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HCONTACT)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((MCONTACT)opdata));
}
}
- SetEncryptionStatus((HCONTACT)opdata, trusted);
+ SetEncryptionStatus((MCONTACT)opdata, trusted);
}
/* Log a message. The passed message will end in "\n". */
void otr_gui_log_message(void *opdata, const char *message) {
//MessageBox(0, message, Translate("OTR Log Message"), MB_OK);
- //ShowMessageInline((HCONTACT)opdata, message);
+ //ShowMessageInline((MCONTACT)opdata, message);
#ifdef _DEBUG
char* msg = strcpy((char*)mir_alloc(strlen(message)+15), "OTR message: ");
strcat(msg, message);
@@ -314,7 +314,7 @@ extern "C" { if (context && context->protocol)
proto = context->protocol;
else
- proto = contact_get_proto((HCONTACT)opdata);
+ proto = contact_get_proto((MCONTACT)opdata);
// ugly wokaround for ICQ. ICQ protocol reports more than 7k, but in SMP this is too long.
// possibly ICQ doesn't allow single words without spaces to become longer than ~2340?
if (strcmp("ICQ", proto)==0 || strncmp("ICQ_", proto, 4)==0)
diff --git a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp index d764a9664b..12fbb966dc 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp @@ -5,7 +5,7 @@ static HGENMENU hStopItem, hStartItem; ////////////////////////////////
///////// Menu Services ////////
///////////////////////////////
-int StartOTR(HCONTACT hContact) {
+int StartOTR(MCONTACT hContact) {
const char *proto = contact_get_proto(hContact);
if (!proto) return 1; // error
@@ -24,8 +24,8 @@ int StartOTR(HCONTACT hContact) { }
INT_PTR SVC_StartOTR(WPARAM wParam, LPARAM lParam) {
- HCONTACT hContact = (HCONTACT)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
+ MCONTACT hContact = (MCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
hContact = hSub;
}
@@ -47,8 +47,8 @@ INT_PTR SVC_StartOTR(WPARAM wParam, LPARAM lParam) { }
INT_PTR SVC_RefreshOTR(WPARAM wParam, LPARAM lParam) {
- HCONTACT hContact = (HCONTACT)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
+ MCONTACT hContact = (MCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
hContact = hSub;
}
@@ -69,10 +69,10 @@ INT_PTR SVC_RefreshOTR(WPARAM wParam, LPARAM lParam) { return 0;
}
-int otr_disconnect_contact(HCONTACT hContact)
+int otr_disconnect_contact(MCONTACT hContact)
{
- HCONTACT hSub;
- if(ServiceExists(MS_MC_GETMOSTONLINECONTACT) && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ MCONTACT hSub;
+ if(ServiceExists(MS_MC_GETMOSTONLINECONTACT) && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
const char *proto = contact_get_proto(hContact);
@@ -89,7 +89,7 @@ int otr_disconnect_contact(HCONTACT hContact) INT_PTR SVC_StopOTR(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
// prevent this filter from acting on injeceted messages for metas, when they are passed though the subcontact's proto send chain
if (otr_disconnect_contact(hContact)) return 0;
@@ -104,11 +104,11 @@ INT_PTR SVC_StopOTR(WPARAM wParam, LPARAM lParam) }
INT_PTR SVC_VerifyOTR(WPARAM wParam, LPARAM lParam) {
- HCONTACT hContact = (HCONTACT)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ MCONTACT hContact = (MCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
- ConnContext *context = otrl_context_find_miranda(otr_user_state, (HCONTACT)wParam);
+ ConnContext *context = otrl_context_find_miranda(otr_user_state, (MCONTACT)wParam);
if (!context) return 1;
//VerifyContextDialog(context);
SMPInitDialog(context);
@@ -116,7 +116,7 @@ INT_PTR SVC_VerifyOTR(WPARAM wParam, LPARAM lParam) { }
INT_PTR SVC_ToggleHTMLOTR(WPARAM wParam, LPARAM lParam) {
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (db_get_b(hContact, MODULENAME, "HTMLConv", 0))
db_set_b(hContact, MODULENAME, "HTMLConv", 0);
else
@@ -154,7 +154,7 @@ void InitMenu() int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_TCHAR;
@@ -171,7 +171,7 @@ hide_all: if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) {
// make menu act as per most online subcontact
- hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (!hContact)
goto hide_all;
proto = contact_get_proto(hContact);
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp index 6c8f36e85e..bebbe8ddbc 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp @@ -5,7 +5,7 @@ BBButton OTRButton; int SVC_IconPressed(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if(sicd->cbSize < (int)sizeof(StatusIconClickData))
return 0;
@@ -21,7 +21,7 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) }
// set SRMM icon status, if applicable
-void SetEncryptionStatus(HCONTACT hContact, TrustLevel level)
+void SetEncryptionStatus(MCONTACT hContact, TrustLevel level)
{
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
@@ -71,8 +71,8 @@ void SetEncryptionStatus(HCONTACT hContact, TrustLevel level) db_set_dw(hContact, MODULENAME, "TrustLevel", level);
if (!chat_room && options.bHaveMetaContacts) {
- HCONTACT hMeta = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
- HCONTACT hMostOnline = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
+ MCONTACT hMeta = (MCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ MCONTACT hMostOnline = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
if(hMeta && hContact == hMostOnline)
SetEncryptionStatus(hMeta, level);
else if(hMeta) {
@@ -95,7 +95,7 @@ int SVC_ButtonsBarPressed(WPARAM w, LPARAM l) {
CustomButtonClickData* cbcd = (CustomButtonClickData *)l;
if (cbcd->cbSize == (int)sizeof(CustomButtonClickData) && cbcd->dwButtonId == 0 && strcmp(cbcd->pszModule, MODULENAME)==0) {
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
char *proto = GetContactProto(hContact);
if(proto && db_get_b(hContact, proto, "ChatRoom", 0))
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.h b/plugins/MirOTR/MirOTR/src/svcs_srmm.h index 7c8842edc3..dc3bbc9672 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_srmm.h +++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.h @@ -2,6 +2,6 @@ int WindowEvent(WPARAM wParam, LPARAM lParam);
int SVC_IconPressed(WPARAM wParam, LPARAM lParam);
-void SetEncryptionStatus(HCONTACT hContact, TrustLevel level);
+void SetEncryptionStatus(MCONTACT hContact, TrustLevel level);
void InitSRMM();
void DeinitSRMM();
\ No newline at end of file diff --git a/plugins/MirOTR/MirOTR/src/utils.cpp b/plugins/MirOTR/MirOTR/src/utils.cpp index 424f4d8886..6ed4c351f9 100644 --- a/plugins/MirOTR/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/MirOTR/src/utils.cpp @@ -22,9 +22,9 @@ void lib_cs_unlock() LeaveCriticalSection(&lib_cs);
}
-HCONTACT find_contact(const char* userid, const char* protocol)
+MCONTACT find_contact(const char* userid, const char* protocol)
{
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
const char *proto = contact_get_proto(hContact);
if(proto && strcmp(proto, protocol) == 0) {
char *name = contact_get_id(hContact);
@@ -44,7 +44,7 @@ HCONTACT find_contact(const char* userid, const char* protocol) * context if one does not currently exist. In that event, call
* add_app_data(data, context) so that app_data and app_data_free can be
* filled in by the application, and set *addedp to 1. */
-ConnContext * otrl_context_find_miranda(OtrlUserState us, HCONTACT hContact)
+ConnContext * otrl_context_find_miranda(OtrlUserState us, MCONTACT hContact)
{
ConnContext ** curp;
if (!hContact) return NULL;
@@ -85,10 +85,10 @@ void VerifyFingerprint(ConnContext *context, bool verify) { void VerifyFingerprintMessage(ConnContext *context, bool verify) {
TCHAR msg[1024];
- mir_sntprintf(msg, 1024, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HCONTACT)context->app_data));
+ mir_sntprintf(msg, 1024, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((MCONTACT)context->app_data));
msg[1023] = '\0';
- ShowMessage((HCONTACT)context->app_data, msg);
- SetEncryptionStatus((HCONTACT)context->app_data, otr_context_get_trust(context));
+ ShowMessage((MCONTACT)context->app_data, msg);
+ SetEncryptionStatus((MCONTACT)context->app_data, otr_context_get_trust(context));
}
/* Convert a 20-byte hash value to a 45-byte human-readable value */
@@ -109,7 +109,7 @@ void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]) *p = '\0';
}
-char* contact_get_id(HCONTACT hContact, bool bNameOnError) {
+char* contact_get_id(MCONTACT hContact, bool bNameOnError) {
char* pszUniqueID = NULL;
CONTACTINFO ci;
ZeroMemory(&ci, sizeof(ci));
@@ -142,21 +142,21 @@ char* contact_get_id(HCONTACT hContact, bool bNameOnError) { return pszUniqueID;
}
-__inline const TCHAR* contact_get_nameT(HCONTACT hContact) {
+__inline const TCHAR* contact_get_nameT(MCONTACT hContact) {
return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
}
-__inline const char* contact_get_proto(HCONTACT hContact) {
+__inline const char* contact_get_proto(MCONTACT hContact) {
char *uproto = GetContactProto(hContact);
return uproto;
}
-__inline const char* contact_get_account(HCONTACT hContact) {
+__inline const char* contact_get_account(MCONTACT hContact) {
char *uacc = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)hContact, 0);
return uacc;
}
-void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HCONTACT hContact) {
+void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTACT hContact) {
if(CallService(MS_SYSTEM_TERMINATED, 0, 0)) return;
if ( !options.bHavePopups) {
@@ -298,7 +298,7 @@ void ShowError(TCHAR *msg) { }
-void ShowPopupUtf(const char* line1, const char* line2, int timeout, const HCONTACT hContact) {
+void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact) {
TCHAR* l1 = (line1) ? mir_utf8decodeT(line1) : NULL;
TCHAR* l2 = (line2) ? mir_utf8decodeT(line2) : NULL;
ShowPopup(l1, l2, timeout, hContact);
@@ -317,7 +317,7 @@ void ShowErrorUtf(char* msg) { if (m) mir_free(m);
}
-void ShowMessageInline(const HCONTACT hContact, const TCHAR *msg) {
+void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) {
TCHAR buff[1024];
mir_sntprintf(buff, 1024, _T("%s%s"), TranslateT(LANG_INLINE_PREFIX), msg);
@@ -331,7 +331,7 @@ void ShowMessageInline(const HCONTACT hContact, const TCHAR *msg) { mir_free(utf);
}
-void ShowMessageInlineUtf(const HCONTACT hContact, const char *msg) {
+void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg) {
char buff[1024];
mir_snprintf(buff, 1024, "%s%s", Translate(LANG_INLINE_PREFIX), msg);
@@ -342,14 +342,14 @@ void ShowMessageInlineUtf(const HCONTACT hContact, const char *msg) { ProtoChainRecvMsg(hContact, &pre);
}
-void ShowMessageUtf(const HCONTACT hContact, const char *msg) {
+void ShowMessageUtf(const MCONTACT hContact, const char *msg) {
if(options.msg_inline)
ShowMessageInlineUtf(hContact, msg);
if(options.msg_popup)
ShowPopupUtf(Translate(LANG_OTR_INFO), msg, 0, hContact);
}
-void ShowMessage(const HCONTACT hContact, const TCHAR *msg) {
+void ShowMessage(const MCONTACT hContact, const TCHAR *msg) {
if(options.msg_inline)
ShowMessageInline(hContact, msg);
if(options.msg_popup)
@@ -358,7 +358,7 @@ void ShowMessage(const HCONTACT hContact, const TCHAR *msg) { /*
-bool GetEncryptionStatus(HCONTACT hContact) {
+bool GetEncryptionStatus(MCONTACT hContact) {
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
diff --git a/plugins/MirOTR/MirOTR/src/utils.h b/plugins/MirOTR/MirOTR/src/utils.h index 1e2a05c9f3..a174e9828e 100644 --- a/plugins/MirOTR/MirOTR/src/utils.h +++ b/plugins/MirOTR/MirOTR/src/utils.h @@ -7,8 +7,8 @@ void lib_cs_lock();
void lib_cs_unlock();
-HCONTACT find_contact(const char* userid, const char* protocol);
-ConnContext * otrl_context_find_miranda(OtrlUserState us, HCONTACT hContact);
+MCONTACT find_contact(const char* userid, const char* protocol);
+ConnContext * otrl_context_find_miranda(OtrlUserState us, MCONTACT hContact);
typedef enum {
TRUST_NOT_PRIVATE,
@@ -22,23 +22,23 @@ void VerifyFingerprintMessage(ConnContext *context, bool verify); void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]);
-char* contact_get_id(HCONTACT hContact, bool bNameOnError=true);
-__inline const char* contact_get_proto(HCONTACT hContact);
-__inline const char* contact_get_account(HCONTACT hContact);
-extern __inline const TCHAR* contact_get_nameT(HCONTACT hContact);
+char* contact_get_id(MCONTACT hContact, bool bNameOnError=true);
+__inline const char* contact_get_proto(MCONTACT hContact);
+__inline const char* contact_get_account(MCONTACT hContact);
+extern __inline const TCHAR* contact_get_nameT(MCONTACT hContact);
-void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HCONTACT hContact = NULL);
+void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTACT hContact = NULL);
void ShowWarning(TCHAR* msg);
void ShowError(TCHAR* msg);
-void ShowPopupUtf(const char* line1, const char* line2, int timeout, const HCONTACT hContact = NULL);
+void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact = NULL);
void ShowWarningUtf(char* msg);
void ShowErrorUtf(char* msg);
-void ShowMessageInline(const HCONTACT hContact, const TCHAR *msg);
-void ShowMessageInlineUtf(const HCONTACT hContact, const char *msg);
+void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg);
+void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg);
-void ShowMessage(const HCONTACT hContact, const TCHAR *msg);
-void ShowMessageUtf(const HCONTACT hContact, const char *msg);
+void ShowMessage(const MCONTACT hContact, const TCHAR *msg);
+void ShowMessageUtf(const MCONTACT hContact, const char *msg);
void InitUtils();
void DeinitUtils();
|