summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-23 13:16:35 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-23 13:16:35 +0300
commitf0e5f631450925938fba4d50e1d6f01d85adc712 (patch)
tree0b152c7a34538701a6e4beade751f4c197890367 /protocols/ICQ-WIM
parentf5980308df254aa17a9f5d94a980fb888b6c193f (diff)
ICQ-WIM:
- fixes #1716 (ICQ10: add to account manager "register or login by phone number" link) - fixes #1744 (ICQ10: pressing OK in settings rewrites registration settings)
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/res/resources.rc88
-rw-r--r--protocols/ICQ-WIM/src/options.cpp11
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp2
-rw-r--r--protocols/ICQ-WIM/src/stdafx.h1
4 files changed, 33 insertions, 69 deletions
diff --git a/protocols/ICQ-WIM/res/resources.rc b/protocols/ICQ-WIM/res/resources.rc
index a792fb924f..d2b7888d8d 100644
--- a/protocols/ICQ-WIM/res/resources.rc
+++ b/protocols/ICQ-WIM/res/resources.rc
@@ -12,67 +12,6 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Russian (Russia) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-#pragma code_page(1251)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_REGISTER DIALOGEX 0, 0, 316, 111
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_APPWINDOW
-CAPTION "Account registration"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,205,90,50,14
- PUSHBUTTON "Cancel",IDCANCEL,259,90,50,14
- LTEXT "Enter full phone number",IDC_STATIC,7,7,302,14
- EDITTEXT IDC_PHONE,7,18,302,14,ES_AUTOHSCROLL
- PUSHBUTTON "Send me registration code via SMS",IDC_SENDSMS,49,37,221,14,BS_CENTER | WS_DISABLED
- LTEXT "Enter registration code",IDC_STATIC,7,58,302,8
- EDITTEXT IDC_CODE,7,70,302,14,ES_AUTOHSCROLL | WS_DISABLED
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_REGISTER, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 309
- TOPMARGIN, 7
- BOTTOMMARGIN, 104
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// AFX_DIALOG_LAYOUT
-//
-
-IDD_REGISTER AFX_DIALOG_LAYOUT
-BEGIN
- 0
-END
-
-#endif // Russian (Russia) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
@@ -93,6 +32,7 @@ BEGIN
EDITTEXT IDC_UIN,54,0,131,12,ES_AUTOHSCROLL
LTEXT "Password:",IDC_STATIC,0,16,53,12
EDITTEXT IDC_PASSWORD,54,16,131,12,ES_PASSWORD | ES_AUTOHSCROLL
+ PUSHBUTTON "Create a new ICQ account",IDC_REGISTER,62,34,122,14
END
IDD_OPTIONS_FULL DIALOGEX 0, 0, 310, 98
@@ -121,6 +61,20 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,158,243,50,14
END
+IDD_REGISTER DIALOGEX 0, 0, 316, 111
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "Account registration"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,205,90,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,259,90,50,14
+ LTEXT "Enter full phone number",IDC_STATIC,7,7,302,14
+ EDITTEXT IDC_PHONE,7,18,302,14,ES_AUTOHSCROLL
+ PUSHBUTTON "Send me registration code via SMS",IDC_SENDSMS,49,37,221,14,BS_CENTER | WS_DISABLED
+ LTEXT "Enter registration code",IDC_STATIC,7,58,302,8
+ EDITTEXT IDC_CODE,7,70,302,14,ES_AUTOHSCROLL | WS_DISABLED
+END
/////////////////////////////////////////////////////////////////////////////
//
@@ -142,6 +96,14 @@ BEGIN
IDD_GROUPCHAT_INVITE, DIALOG
BEGIN
END
+
+ IDD_REGISTER, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 309
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 104
+ END
END
#endif // APSTUDIO_INVOKED
@@ -166,6 +128,10 @@ BEGIN
0
END
+IDD_REGISTER AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp
index 3ff4494232..4b2bd88035 100644
--- a/protocols/ICQ-WIM/src/options.cpp
+++ b/protocols/ICQ-WIM/src/options.cpp
@@ -148,7 +148,7 @@ void CIcqProto::OnLoginViaPhone(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pRe
setString(DB_KEY_SESSIONKEY, m_szSessionKey);
m_dwUin = _wtoi(data["loginId"].as_mstring());
- setByte("PhoneReg", 1);
+ setByte(DB_KEY_PHONEREG, 1);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -186,7 +186,7 @@ public:
if (wszOldPass != ptrW(edtPassword.GetText())) {
m_proto->delSetting(DB_KEY_ATOKEN);
m_proto->delSetting(DB_KEY_SESSIONKEY);
- m_proto->delSetting("PhoneReg");
+ m_proto->delSetting(DB_KEY_PHONEREG);
}
return true;
}
@@ -195,11 +195,8 @@ public:
{
CIcqRegistrationDlg dlg(m_proto);
dlg.SetParent(m_hwnd);
- if (dlg.DoModal()) {
- edtUin.SetInt(m_proto->getDword(DB_KEY_UIN));
- edtPassword.SetText(L"");
- wszOldPass.Empty();
- }
+ if (dlg.DoModal()) // force exit to avoid data corruption
+ PostMessage(m_hwndParent, WM_COMMAND, MAKELONG(IDCANCEL, BN_CLICKED), 0);
}
};
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 90d1259fdd..ed713f3983 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -408,7 +408,7 @@ int CIcqProto::SetStatus(int iNewStatus)
return 0;
}
- if (!getByte("PhoneReg") && mir_wstrlen(m_szPassword) == 0) {
+ if (!getByte(DB_KEY_PHONEREG) && mir_wstrlen(m_szPassword) == 0) {
debugLogA("Thread ended, password is not configured");
ConnectionFailed(LOGINERR_BADUSERID);
return 0;
diff --git a/protocols/ICQ-WIM/src/stdafx.h b/protocols/ICQ-WIM/src/stdafx.h
index 59e77234f8..ed564a18f0 100644
--- a/protocols/ICQ-WIM/src/stdafx.h
+++ b/protocols/ICQ-WIM/src/stdafx.h
@@ -82,6 +82,7 @@
#define DB_KEY_UIN "UIN"
#define DB_KEY_ATOKEN "AToken"
+#define DB_KEY_PHONEREG "PhoneReg"
#define DB_KEY_RCLIENTID "RClientID"
#define DB_KEY_LASTMSGID "LastMsgId"
#define DB_KEY_REMOTEREAD "RemoteReadId"