diff options
author | George Hazan <george.hazan@gmail.com> | 2013-01-30 14:25:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-01-30 14:25:01 +0000 |
commit | eb8ce4835cfe80601daaf64b6f842e63b85e62af (patch) | |
tree | 0a6efec04fb4330daea0a48ed2456048bacbe53e /protocols/MSN/src/msn_opts.cpp | |
parent | 8e1b69f9327909134a9646d3f182155125623b70 (diff) |
copyright update
fixes #204
git-svn-id: http://svn.miranda-ng.org/main/trunk@3367 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_opts.cpp')
-rw-r--r-- | protocols/MSN/src/msn_opts.cpp | 132 |
1 files changed, 67 insertions, 65 deletions
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 30e74d4d36..2acbb835b1 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -1,5 +1,7 @@ /*
Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
+
+Copyright (c) 2012-2013 Miranda NG Team
Copyright (c) 2006-2012 Boris Krasnovskiy.
Copyright (c) 2003-2005 George Hazan.
Copyright (c) 2002-2003 Richard Hughes (original version).
@@ -78,9 +80,9 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
+ switch (msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -90,7 +92,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);
char tBuffer[MAX_PATH];
- if (!proto->getStaticString(NULL, "Password", tBuffer, sizeof(tBuffer)))
+ if (!proto->getStaticString(NULL, "Password", tBuffer, sizeof(tBuffer)))
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(tBuffer)+1, (LPARAM)tBuffer);
tBuffer[16] = 0;
@@ -100,13 +102,13 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND wnd = GetDlgItem(hwndDlg, IDC_HANDLE2);
DBVARIANT dbv;
- if (!proto->getTString("Nick", &dbv))
+ if (!proto->getTString("Nick", &dbv))
{
SetWindowText(wnd, dbv.ptszVal);
MSN_FreeVariant(&dbv);
}
EnableWindow(wnd, proto->msnLoggedIn);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MOBILESEND), proto->msnLoggedIn &&
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MOBILESEND), proto->msnLoggedIn &&
proto->getByte("MobileEnabled", 0) && proto->getByte("MobileAllowed", 0));
CheckDlgButton(hwndDlg, IDC_MOBILESEND, proto->getByte("MobileAllowed", 0));
@@ -121,7 +123,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (!proto->getStaticString(NULL, "MailerPath", tBuffer, sizeof(tBuffer)))
SetDlgItemTextA(hwndDlg, IDC_MAILER_APP, tBuffer);
- if (!proto->msnLoggedIn)
+ if (!proto->msnLoggedIn)
{
EnableWindow(GetDlgItem(hwndDlg, IDC_MANAGEGROUPS), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS), FALSE);
@@ -131,24 +133,24 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case WM_COMMAND:
- if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK)
+ if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK)
{
CallService(MS_UTILS_OPENURL, 1, (LPARAM)"https://signup.live.com");
return TRUE;
}
- if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
+ if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDC_HANDLE: case IDC_PASSWORD: case IDC_HANDLE2:
case IDC_GATEWAYSERVER: case IDC_YOURHOST: case IDC_DIRECTSERVER:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ }
}
if (HIWORD(wParam) == BN_CLICKED)
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDC_SENDFONTINFO:
case IDC_DISABLE_ANOTHER_CONTACTS:
@@ -170,7 +172,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case IDC_RUN_APP_ON_HOTMAIL:
+ case IDC_RUN_APP_ON_HOTMAIL:
{
BOOL tIsChosen = IsDlgButtonChecked(hwndDlg, IDC_RUN_APP_ON_HOTMAIL);
EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tIsChosen);
@@ -179,7 +181,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
}
- case IDC_ENTER_MAILER_APP:
+ case IDC_ENTER_MAILER_APP:
{
HWND tEditField = GetDlgItem(hwndDlg, IDC_MAILER_APP);
@@ -188,19 +190,19 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP size_t tSelectLen = 0;
- if (szFile[0] == '\"')
+ if (szFile[0] == '\"')
{
char* p = strchr(szFile+1, '\"');
- if (p != NULL)
+ if (p != NULL)
{
*p = '\0';
memmove(szFile, szFile+1, strlen(szFile));
tSelectLen += 2;
goto LBL_Continue;
- }
+ }
}
- {
+ {
char* p = strchr(szFile, ' ');
if (p != NULL) *p = '\0';
}
@@ -216,7 +218,7 @@ LBL_Continue: if (GetOpenFileNameA(&ofn) != TRUE)
break;
- if (strchr(szFile, ' ') != NULL)
+ if (strchr(szFile, ' ') != NULL)
{
char tmpBuf[MAX_PATH + 2];
mir_snprintf(tmpBuf, sizeof(tmpBuf), "\"%s\"", szFile);
@@ -226,13 +228,13 @@ LBL_Continue: SendMessage(tEditField, EM_SETSEL, 0, tSelectLen);
SendMessageA(tEditField, EM_REPLACESEL, TRUE, LPARAM(szFile));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ }
}
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
+ if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
{
bool reconnectRequired = false;
TCHAR screenStr[MAX_PATH];
@@ -242,7 +244,7 @@ LBL_Continue: CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemTextA(hwndDlg, IDC_HANDLE, szEmail, sizeof(szEmail));
- if (strcmp(_strlwr(szEmail), proto->MyOptions.szEmail))
+ if (strcmp(_strlwr(szEmail), proto->MyOptions.szEmail))
{
reconnectRequired = true;
strcpy(proto->MyOptions.szEmail, szEmail);
@@ -251,23 +253,23 @@ LBL_Continue: GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, sizeof(password));
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(password),(LPARAM)password);
- if (!proto->getString("Password", &dbv))
+ if (!proto->getString("Password", &dbv))
{
- if (strcmp(password, dbv.pszVal))
+ if (strcmp(password, dbv.pszVal))
{
reconnectRequired = true;
proto->setString("Password", password);
}
MSN_FreeVariant(&dbv);
}
- else
+ else
{
reconnectRequired = true;
proto->setString("Password", password);
}
GetDlgItemText(hwndDlg, IDC_HANDLE2, screenStr, SIZEOF(screenStr));
- if (!proto->getTString("Nick", &dbv))
+ if (!proto->getTString("Nick", &dbv))
{
if (_tcscmp(dbv.ptszVal, screenStr))
proto->MSN_SendNickname(screenStr);
@@ -286,7 +288,7 @@ LBL_Continue: }
unsigned tValue = IsDlgButtonChecked(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS);
- if (tValue != proto->msnOtherContactsBlocked && proto->msnLoggedIn)
+ if (tValue != proto->msnOtherContactsBlocked && proto->msnLoggedIn)
{
proto->msnOtherContactsBlocked = tValue;
proto->msnNsThread->sendPacket("BLP", tValue ? "BL" : "AL");
@@ -302,7 +304,7 @@ LBL_Continue: proto->setTString("MailerPath", screenStr);
if (reconnectRequired && proto->msnLoggedIn)
- MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the MSN Messenger network before they take effect"),
+ MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the MSN Messenger network before they take effect"),
TranslateT("MSN Options"), MB_OK);
proto->LoadOptions();
@@ -328,20 +330,20 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
CMsnProto* proto = (CMsnProto*)lParam;
- if (!proto->getString(NULL, "DirectServer", &dbv))
+ if (!proto->getString(NULL, "DirectServer", &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, dbv.pszVal);
MSN_FreeVariant(&dbv);
}
- else
+ else
SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
- if (!proto->getString(NULL, "GatewayServer", &dbv))
+ if (!proto->getString(NULL, "GatewayServer", &dbv))
{
SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, dbv.pszVal);
MSN_FreeVariant(&dbv);
}
- else
+ else
SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);
CheckDlgButton(hwndDlg, IDC_SLOWSEND, proto->getByte("SlowSend", 0));
@@ -354,14 +356,14 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam if (gethst < 2) gethst = !gethst;
char ipaddr[256] = "";
- if (gethst == 1)
+ if (gethst == 1)
{
if (proto->getStaticString(NULL, "YourHost", ipaddr, sizeof(ipaddr)))
gethst = 0;
}
if (gethst == 0)
{
- mir_snprintf(ipaddr, sizeof(ipaddr), "%s", proto->msnLoggedIn ?
+ mir_snprintf(ipaddr, sizeof(ipaddr), "%s", proto->msnLoggedIn ?
proto->MyConnection.GetMyExtIPStr() : "");
}
SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_SETCURSEL, gethst, 0);
@@ -375,7 +377,7 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam }
case WM_COMMAND:
- switch (LOWORD(wParam))
+ switch (LOWORD(wParam))
{
case IDC_RESETSERVER:
SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
@@ -401,17 +403,17 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam if (HIWORD(wParam) == BN_CLICKED)
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDC_SLOWSEND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- }
+ }
}
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
+ if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
{
bool reconnectRequired = false;
char str[MAX_PATH];
@@ -433,10 +435,10 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam proto->setByte("SlowSend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SLOWSEND ));
if (proto->getByte("SlowSend", FALSE))
{
- if (DBGetContactSettingDword(NULL, "SRMsg", "MessageTimeout", 60000) < 60000 ||
- DBGetContactSettingDword(NULL, "SRMM", "MessageTimeout", 60000) < 60000)
+ if (DBGetContactSettingDword(NULL, "SRMsg", "MessageTimeout", 60000) < 60000 ||
+ DBGetContactSettingDword(NULL, "SRMM", "MessageTimeout", 60000) < 60000)
{
- MessageBox(NULL, TranslateT("MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value."),
+ MessageBox(NULL, TranslateT("MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value."),
TranslateT("MSN Protocol"), MB_OK|MB_ICONINFORMATION);
}
}
@@ -460,12 +462,12 @@ static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam }
if (reconnectRequired && proto->msnLoggedIn)
- MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the MSN Messenger network before they take effect"),
+ MessageBox(hwndDlg, TranslateT("The changes you have made require you to reconnect to the MSN Messenger network before they take effect"),
TranslateT("MSN Options"), MB_OK);
proto->LoadOptions();
return TRUE;
- }
+ }
}
return FALSE;
@@ -478,9 +480,9 @@ static INT_PTR CALLBACK DlgProcHotmailPopUpOpts(HWND hwndDlg, UINT msg, WPARAM w {
static bool bEnabled;
- switch(msg)
+ switch(msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
bEnabled = false;
@@ -502,11 +504,11 @@ static INT_PTR CALLBACK DlgProcHotmailPopUpOpts(HWND hwndDlg, UINT msg, WPARAM w return TRUE;
}
case WM_COMMAND:
- switch (LOWORD(wParam))
+ switch (LOWORD(wParam))
{
case IDC_DISABLEHOTMAILPOPUP:
- case IDC_DISABLEHOTMAILTRAY:
- case IDC_DISABLEHOTMAILCL:
+ case IDC_DISABLEHOTMAILTRAY:
+ case IDC_DISABLEHOTMAILCL:
case IDC_DISABLEHOTJUNK:
case IDC_NOTIFY_ENDSESSION:
case IDC_NOTIFY_FIRSTMSG:
@@ -518,19 +520,19 @@ static INT_PTR CALLBACK DlgProcHotmailPopUpOpts(HWND hwndDlg, UINT msg, WPARAM w break;
case WM_NOTIFY: //Here we have pressed either the OK or the APPLY button.
- switch(((LPNMHDR)lParam)->idFrom)
+ switch(((LPNMHDR)lParam)->idFrom)
{
case 0:
- switch (((LPNMHDR)lParam)->code)
+ switch (((LPNMHDR)lParam)->code)
{
- case PSN_RESET:
+ case PSN_RESET:
{
CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
proto->LoadOptions();
return TRUE;
}
- case PSN_APPLY:
+ case PSN_APPLY:
{
CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -559,9 +561,9 @@ static INT_PTR CALLBACK DlgProcHotmailPopUpOpts(HWND hwndDlg, UINT msg, WPARAM w static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg)
+ switch(msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -571,7 +573,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);
char tBuffer[MAX_PATH];
- if (!proto->getStaticString(NULL, "Password", tBuffer, sizeof(tBuffer)))
+ if (!proto->getStaticString(NULL, "Password", tBuffer, sizeof(tBuffer)))
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(tBuffer)+1, (LPARAM)tBuffer);
tBuffer[16] = 0;
@@ -589,15 +591,15 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L }
case WM_COMMAND:
- if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK)
+ if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK)
{
CallService(MS_UTILS_OPENURL, 1, (LPARAM)"https://signup.live.com");
return TRUE;
}
- if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
+ if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
{
- switch(LOWORD(wParam))
+ switch(LOWORD(wParam))
{
case IDC_HANDLE: case IDC_PASSWORD:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -606,7 +608,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
+ if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
{
char password[100], szEmail[MSN_MAX_EMAIL_LEN];
DBVARIANT dbv;
@@ -628,7 +630,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L proto->setString("Password", password);
MSN_FreeVariant(&dbv);
}
- else
+ else
proto->setString("Password", password);
TCHAR szPlace[64];
@@ -648,9 +650,9 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg)
+ switch(msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
return TRUE;
@@ -660,7 +662,7 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case WM_COMMAND:
- if (LOWORD(wParam) == IDOK)
+ if (LOWORD(wParam) == IDOK)
{
int isBlock = IsDlgButtonChecked(hwndDlg, IDC_REMOVEBLOCK);
int isHot = IsDlgButtonChecked(hwndDlg, IDC_REMOVEHOT);
@@ -668,11 +670,11 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DeleteParam *param = (DeleteParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char szEmail[MSN_MAX_EMAIL_LEN];
- if (!param->proto->getStaticString(param->hContact, "e-mail", szEmail, sizeof(szEmail)))
+ if (!param->proto->getStaticString(param->hContact, "e-mail", szEmail, sizeof(szEmail)))
{
param->proto->MSN_AddUser(param->hContact, szEmail, 0, LIST_FL | (isHot ? LIST_REMOVE : LIST_REMOVENH));
- if (isBlock)
+ if (isBlock)
{
param->proto->MSN_AddUser(param->hContact, szEmail, 0, LIST_AL | LIST_REMOVE);
param->proto->MSN_AddUser(param->hContact, szEmail, 0, LIST_BL);
@@ -723,7 +725,7 @@ int CMsnProto::OnOptionsInit(WPARAM wParam,LPARAM lParam) INT_PTR CMsnProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam)
{
- return (INT_PTR)CreateDialogParam (hInst, MAKEINTRESOURCE(IDD_ACCMGRUI),
+ return (INT_PTR)CreateDialogParam (hInst, MAKEINTRESOURCE(IDD_ACCMGRUI),
(HWND)lParam, DlgProcAccMgrUI, (LPARAM)this);
}
|