summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_captcha.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-23 15:17:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-23 15:17:45 +0300
commit3d977685e7dbc7b1f5fa3264c8a014b5b5d5ec43 (patch)
tree3be179d8a33dd4ab623d330f628ef09f078f3fa4 /protocols/JabberG/src/jabber_captcha.cpp
parent475debe8c34567137be9c1fd2252ed8816c6da31 (diff)
code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_captcha.cpp')
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index c44879fc96..e75d79fcaa 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -48,7 +48,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
params = (CAPTCHA_FORM_PARAMS*)lParam;
LPCTSTR hint = params->hint;
- if (hint == NULL)
+ if (hint == nullptr)
hint = TranslateT("Enter the text you see");
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateW(hint));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
@@ -62,7 +62,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_TITLE:
return (INT_PTR)GetStockObject(WHITE_BRUSH);
}
- return NULL;
+ return 0;
case WM_PAINT:
if (params) {
@@ -112,25 +112,25 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
{
HXML x = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
- if (x == NULL)
+ if (x == nullptr)
return false;
HXML y = XmlGetChildByTag(x, L"field", L"var", L"from");
- if (y == NULL)
+ if (y == nullptr)
return false;
- if ((y = XmlGetChild(y, "value")) == NULL)
+ if ((y = XmlGetChild(y, "value")) == nullptr)
return false;
CAPTCHA_FORM_PARAMS param;
param.fromjid = XmlGetText(y);
- if ((y = XmlGetChildByTag(x, L"field", L"var", L"sid")) == NULL)
+ if ((y = XmlGetChildByTag(x, L"field", L"var", L"sid")) == nullptr)
return false;
- if ((y = XmlGetChild(y, "value")) == NULL)
+ if ((y = XmlGetChild(y, "value")) == nullptr)
return false;
param.sid = XmlGetText(y);
- if ((y = XmlGetChildByTag(x, L"field", L"var", L"ocr")) == NULL)
+ if ((y = XmlGetChildByTag(x, L"field", L"var", L"ocr")) == nullptr)
return false;
param.hint = XmlGetAttrValue (y, L"label");
@@ -138,12 +138,12 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
param.to = XmlGetAttrValue(parentNode, L"to");
param.challenge = XmlGetAttrValue(parentNode, L"id");
HXML o = XmlGetChild(parentNode, "data");
- if (o == NULL || XmlGetText(o) == NULL)
+ if (o == nullptr || XmlGetText(o) == nullptr)
return false;
unsigned bufferLen;
ptrA buffer((char*)mir_base64_decode( _T2A(XmlGetText(o)), &bufferLen));
- if (buffer == NULL)
+ if (buffer == nullptr)
return false;
IMGSRVC_MEMIO memio;
@@ -157,7 +157,7 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
GetObject(param.bmp, sizeof(bmp), &bmp);
param.w = bmp.bmWidth;
param.h = bmp.bmHeight;
- int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, JabberCaptchaFormDlgProc, (LPARAM)&param);
+ int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), nullptr, JabberCaptchaFormDlgProc, (LPARAM)&param);
if (mir_wstrcmp(param.Result, L"") == 0 || !res)
sendCaptchaError(info, param.from, param.to, param.challenge);
else