diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-26 20:45:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-26 20:45:56 +0300 |
commit | c6e113731519bb85e0a79196ad32986e8b077e07 (patch) | |
tree | 551ea901904f0225099a80e5710d8295a7e9a7b2 | |
parent | c5ac09f8f9da22213e1471370f54343e12a139ac (diff) |
icq10: options dialog
-rw-r--r-- | protocols/Icq10/icq10.vcxproj | 2 | ||||
-rw-r--r-- | protocols/Icq10/res/resources.rc | 105 | ||||
-rw-r--r-- | protocols/Icq10/src/http.cpp | 6 | ||||
-rw-r--r-- | protocols/Icq10/src/options.cpp | 58 | ||||
-rw-r--r-- | protocols/Icq10/src/proto.cpp | 10 | ||||
-rw-r--r-- | protocols/Icq10/src/proto.h | 20 | ||||
-rw-r--r-- | protocols/Icq10/src/resource.h | 147 | ||||
-rw-r--r-- | protocols/Icq10/src/server.cpp | 5 |
8 files changed, 100 insertions, 253 deletions
diff --git a/protocols/Icq10/icq10.vcxproj b/protocols/Icq10/icq10.vcxproj index 1c6a247732..d780943e95 100644 --- a/protocols/Icq10/icq10.vcxproj +++ b/protocols/Icq10/icq10.vcxproj @@ -19,7 +19,7 @@ </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> - <ProjectName>Icq10</ProjectName> + <ProjectName>Icq</ProjectName> <ProjectGuid>{EFB2355B-82B3-4759-B7D8-95F8E9506291}</ProjectGuid> </PropertyGroup> <ImportGroup Label="PropertySheets"> diff --git a/protocols/Icq10/res/resources.rc b/protocols/Icq10/res/resources.rc index 424b919f93..5a845f575e 100644 --- a/protocols/Icq10/res/resources.rc +++ b/protocols/Icq10/res/resources.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Dialog // -IDD_ICQACCOUNT DIALOGEX 0, 0, 186, 68 +IDD_OPTIONS_ACCMGR DIALOGEX 0, 0, 186, 68 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 @@ -31,110 +31,19 @@ BEGIN LTEXT "ICQ Number:",IDC_STATIC,0,0,53,12 EDITTEXT IDC_UIN,54,0,131,12,ES_AUTOHSCROLL LTEXT "Password:",IDC_STATIC,0,16,53,12 - EDITTEXT IDC_PW,54,16,131,12,ES_PASSWORD | ES_AUTOHSCROLL - CONTROL "Create a new ICQ account",IDC_REGISTER,"Hyperlink",WS_TABSTOP,0,49,174,12 + EDITTEXT IDC_PASSWORD,54,16,131,12,ES_PASSWORD | ES_AUTOHSCROLL END -IDD_OPT_ICQ DIALOGEX 0, 0, 310, 234 +IDD_OPTIONS_FULL DIALOGEX 0, 0, 310, 234 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "ICQ",IDC_STICQGROUP,4,0,302,93 - RTEXT "ICQ number:",IDC_STATIC11,12,14,51,8 - EDITTEXT IDC_ICQNUM,68,12,106,12,ES_AUTOHSCROLL - RTEXT "Password:",IDC_STATIC12,12,28,51,8 + GROUPBOX "ICQ",IDC_STATIC,4,0,302,93 + RTEXT "ICQ number:",IDC_STATIC,12,14,51,8 + EDITTEXT IDC_UIN,68,12,106,12,ES_AUTOHSCROLL + RTEXT "Password:",IDC_STATIC,12,28,51,8 EDITTEXT IDC_PASSWORD,68,26,106,12,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "Hint: If you don't enter your password here, Miranda will ask for the password every time you try to go online.",IDC_STATIC,12,43,286,19 - CONTROL "Retrieve a lost password or ICQ number",IDC_LOOKUPLINK, - "Hyperlink",WS_TABSTOP,12,78,286,8 - CONTROL "Create a new ICQ account using the ICQ website",IDC_NEWUINLINK, - "Hyperlink",WS_TABSTOP,12,66,286,8 - GROUPBOX "Connection settings",IDC_STATIC,4,94,302,136 - LTEXT "Login Server:",IDC_STATIC,12,108,55,8 - EDITTEXT IDC_ICQSERVER,68,106,106,12,ES_AUTOHSCROLL - LTEXT "Port:",IDC_STATIC,182,108,25,8 - EDITTEXT IDC_ICQPORT,208,106,29,12,ES_AUTOHSCROLL | ES_NUMBER - PUSHBUTTON "Default",IDC_RESETSERVER,241,106,56,12 - LTEXT "Hint: Use port 0 to connect on a random port. Try port 80 or port 443 if you are having problems connecting through an http proxy server.",IDC_STATIC,12,120,286,18 - CONTROL "Secure Connection (SSL)",IDC_SSL,"Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,12,138,290,10 - CONTROL "Secure (MD5) login",IDC_MD5LOGIN,"Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,12,150,290,10 - CONTROL "Legacy fix (for ICQ Groupware or IServerD only)",IDC_LEGACY, - "Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,12,162,290,10 - CONTROL "Send 'Keep-alives' (enable this if you use a proxy server and frequently get disconnected)",IDC_KEEPALIVE, - "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,12,174,290,18 - CONTROL "Ignore concurrent error messages",IDC_NOERRMULTI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,192,290,10 - LTEXT "Show connection error messages:",IDC_STATIC,12,204,290,8 - CONTROL "Slider1",IDC_LOGLEVEL,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,12,216,58,10 - LTEXT "",IDC_LEVELDESCR,72,216,230,10,SS_NOPREFIX -END - -IDD_OPT_POPUPS DIALOGEX 0, 0, 314, 251 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Options",IDC_STATIC,4,4,305,71 - CONTROL "Enable popup support",IDC_POPUPS_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,19,216,10 - CONTROL "Display errors using popups",IDC_POPUPS_LOG_ENABLED, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,37,216,10 - CONTROL "Display popup when spambot is detected",IDC_POPUPS_SPAM_ENABLED, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,50,216,10 - GROUPBOX "Look && Feel",IDC_STATIC,4,80,305,160 - LTEXT "Back Color",IDC_STATIC,80,93,42,8 - LTEXT "Text Color",IDC_STATIC,130,93,40,8 - LTEXT "Timeout",IDC_STATIC,182,93,60,8 - LTEXT "Note",IDC_STATIC,12,105,60,8 - CONTROL "",IDC_POPUP_LOG0_BACKCOLOR,"ColourPicker",WS_TABSTOP,80,104,39,10 - CONTROL "",IDC_POPUP_LOG0_TEXTCOLOR,"ColourPicker",WS_TABSTOP,130,104,39,10 - EDITTEXT IDC_POPUP_LOG0_TIMEOUT,182,103,34,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Warning",IDC_STATIC,12,120,60,8 - CONTROL "",IDC_POPUP_LOG1_BACKCOLOR,"ColourPicker",WS_TABSTOP,80,119,39,10 - CONTROL "",IDC_POPUP_LOG1_TEXTCOLOR,"ColourPicker",WS_TABSTOP,130,119,39,10 - EDITTEXT IDC_POPUP_LOG1_TIMEOUT,182,118,34,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Error",IDC_STATIC,12,135,60,8 - CONTROL "",IDC_POPUP_LOG2_BACKCOLOR,"ColourPicker",WS_TABSTOP,80,134,39,10 - CONTROL "",IDC_POPUP_LOG2_TEXTCOLOR,"ColourPicker",WS_TABSTOP,130,134,39,10 - EDITTEXT IDC_POPUP_LOG2_TIMEOUT,182,133,34,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Fatal",IDC_STATIC,12,150,60,8 - CONTROL "",IDC_POPUP_LOG3_BACKCOLOR,"ColourPicker",WS_TABSTOP,80,149,39,10 - CONTROL "",IDC_POPUP_LOG3_TEXTCOLOR,"ColourPicker",WS_TABSTOP,130,149,39,10 - EDITTEXT IDC_POPUP_LOG3_TIMEOUT,182,148,34,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Spam detected",IDC_STATIC,12,165,60,8 - CONTROL "",IDC_POPUP_SPAM_BACKCOLOR,"ColourPicker",WS_TABSTOP,80,164,39,10 - CONTROL "",IDC_POPUP_SPAM_TEXTCOLOR,"ColourPicker",WS_TABSTOP,130,164,39,10 - EDITTEXT IDC_POPUP_SPAM_TIMEOUT,182,163,34,12,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "&Use Windows colors",IDC_USEWINCOLORS,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,12,183,220,8 - CONTROL "Use system &icons",IDC_USESYSICONS,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,12,211,220,8 - DEFPUSHBUTTON "Previe&w",IDC_PREVIEW,247,192,52,12 - CONTROL "Use default colors",IDC_USEDEFCOLORS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,12,196,221,10 -END - -IDD_INFO_ICQ DIALOGEX 0, 0, 222, 132 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "UIN:",IDC_UINSTATIC,5,5,71,8 - EDITTEXT IDC_UIN,74,5,143,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "External IP:",IDC_STATIC,5,18,71,8 - EDITTEXT IDC_IP,74,18,74,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Internal IP:",IDC_STATIC,5,31,71,8 - EDITTEXT IDC_REALIP,74,31,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Port:",IDC_STATIC,5,44,71,8 - EDITTEXT IDC_PORT,74,44,141,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Protocol Version:",IDC_STATIC,5,57,71,8 - EDITTEXT IDC_VERSION,74,57,142,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "User Client:",IDC_STATIC,5,70,71,8 - EDITTEXT IDC_MIRVER,74,70,141,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Online since:",IDC_STATIC,5,83,71,8 - EDITTEXT IDC_ONLINESINCE,74,83,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "System up since:",IDC_SUPTIME,5,96,71,8 - EDITTEXT IDC_SYSTEMUPTIME,74,96,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Idle since:",IDC_STATIC,5,109,71,8 - EDITTEXT IDC_IDLETIME,74,109,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - LTEXT "Status:",IDC_STATIC,5,122,71,8 - EDITTEXT IDC_STATUS,74,122,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER END ///////////////////////////////////////////////////////////////////////////// diff --git a/protocols/Icq10/src/http.cpp b/protocols/Icq10/src/http.cpp index c7a183fa3c..eb2e07646d 100644 --- a/protocols/Icq10/src/http.cpp +++ b/protocols/Icq10/src/http.cpp @@ -27,9 +27,7 @@ void __cdecl CIcqProto::ServerThread(void*) memset(&m_ConnPool, 0, sizeof(m_ConnPool)); m_bTerminated = false; - int uin = getDword("UIN"); - ptrA szPassword(getStringA("Password")); - if (uin == 0 || szPassword == nullptr) { + if (m_dwUin == 0 || mir_strlen(m_szPassword) == 0) { debugLogA("Thread ended, UIN/password are not configured"); ConnectionFailed(LOGINERR_BADUSERID); return; @@ -45,7 +43,7 @@ void __cdecl CIcqProto::ServerThread(void*) if (m_szAToken.IsEmpty() || m_szSessionKey.IsEmpty()) { auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_POST, "https://api.login.icq.net/auth/clientLogin", &CIcqProto::OnCheckPassword); pReq << CHAR_PARAM("clientName", "Miranda NG") << CHAR_PARAM("clientVersion", mirVer) << CHAR_PARAM("devId", ICQ_APP_ID) - << CHAR_PARAM("f", "json") << CHAR_PARAM("tokenType", "longTerm") << INT_PARAM("s", uin) << CHAR_PARAM("pwd", szPassword); + << CHAR_PARAM("f", "json") << CHAR_PARAM("tokenType", "longTerm") << INT_PARAM("s", m_dwUin) << CHAR_PARAM("pwd", m_szPassword); pReq->flags |= NLHRF_NODUMPSEND; Push(pReq); } diff --git a/protocols/Icq10/src/options.cpp b/protocols/Icq10/src/options.cpp new file mode 100644 index 0000000000..4dc2175a13 --- /dev/null +++ b/protocols/Icq10/src/options.cpp @@ -0,0 +1,58 @@ +// ----------------------------------------------------------------------------- +// ICQ plugin for Miranda NG +// ----------------------------------------------------------------------------- +// Copyright © 2018 Miranda NG team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +class CIcqOptionsDlg : public CProtoDlgBase<CIcqProto> +{ + CCtrlEdit edtUin, edtPassword; + +public: + CIcqOptionsDlg(CIcqProto *ppro, int iDlgID, bool bFullDlg) : + CProtoDlgBase<CIcqProto>(ppro, iDlgID), + edtUin(this, IDC_UIN), + edtPassword(this, IDC_PASSWORD) + { + CreateLink(edtUin, ppro->m_dwUin); + CreateLink(edtPassword, ppro->m_szPassword); + } +}; + +INT_PTR CIcqProto::CreateAccMgrUI(WPARAM, LPARAM hwndParent) +{ + CIcqOptionsDlg *pDlg = new CIcqOptionsDlg(this, IDD_OPTIONS_ACCMGR, false); + pDlg->SetParent((HWND)hwndParent); + pDlg->Create(); + return (INT_PTR)pDlg->GetHwnd(); +} + +int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM) +{ + OPTIONSDIALOGPAGE odp = {}; + odp.szTitle.w = m_tszUserName; + odp.flags = ODPF_UNICODE; + odp.szGroup.w = LPGENW("Network"); + + odp.position = 1; +// odp.szTab.w = LPGENW("Account"); + odp.pDialog = new CIcqOptionsDlg(this, IDD_OPTIONS_FULL, true); + g_plugin.addOptions(wParam, &odp); + return 0; +} diff --git a/protocols/Icq10/src/proto.cpp b/protocols/Icq10/src/proto.cpp index 89a9cd8006..e731f2d488 100644 --- a/protocols/Icq10/src/proto.cpp +++ b/protocols/Icq10/src/proto.cpp @@ -38,13 +38,21 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) : m_arHttpQueue(10), m_arOwnIds(1), m_arCache(20, NumericKeySortT), - m_evRequestsQueue(CreateEvent(nullptr, FALSE, FALSE, nullptr)) + m_evRequestsQueue(CreateEvent(nullptr, FALSE, FALSE, nullptr)), + m_dwUin(this, "UIN", 0), + m_szPassword(this, "Password") { + // services + CreateProtoService(PS_CREATEACCMGRUI, &CIcqProto::CreateAccMgrUI); CreateProtoService(PS_GETAVATARINFO, &CIcqProto::GetAvatarInfo); CreateProtoService(PS_GETMYAVATAR, &CIcqProto::GetAvatar); CreateProtoService(PS_GETAVATARCAPS, &CIcqProto::GetAvatarCaps); CreateProtoService(PS_SETMYAVATAR, &CIcqProto::SetAvatar); + // events + HookProtoEvent(ME_OPT_INITIALISE, &CIcqProto::OnOptionsInit); + + // netlib handle CMStringW descr(FORMAT, TranslateT("%s server connection"), m_tszUserName); NETLIBUSER nlu = {}; diff --git a/protocols/Icq10/src/proto.h b/protocols/Icq10/src/proto.h index 8bf9cbfb91..9b28adc787 100644 --- a/protocols/Icq10/src/proto.h +++ b/protocols/Icq10/src/proto.h @@ -93,7 +93,7 @@ class CIcqProto : public PROTO<CIcqProto> OBJLIST<IcqOwnMessage> m_arOwnIds; - ////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// // http queue mir_cs m_csHttpQueue; @@ -103,7 +103,7 @@ class CIcqProto : public PROTO<CIcqProto> void ExecuteRequest(AsyncHttpRequest*); void Push(MHttpRequest*); - ////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// // cache mir_cs m_csCache; @@ -114,7 +114,7 @@ class CIcqProto : public PROTO<CIcqProto> void GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbLen); - ////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// // threads HANDLE m_hWorkerThread; @@ -123,15 +123,22 @@ class CIcqProto : public PROTO<CIcqProto> HANDLE m_hPollThread; void __cdecl PollThread(void*); - ////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// // services INT_PTR __cdecl GetAvatar(WPARAM, LPARAM); INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM); INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM); INT_PTR __cdecl SetAvatar(WPARAM, LPARAM); + + INT_PTR __cdecl CreateAccMgrUI(WPARAM, LPARAM); - ////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// + // events + + int __cdecl OnOptionsInit(WPARAM, LPARAM); + + //////////////////////////////////////////////////////////////////////////////////////// // PROTO_INTERFACE MCONTACT AddToList( int flags, PROTOSEARCHRESULT *psr) override; @@ -178,6 +185,9 @@ class CIcqProto : public PROTO<CIcqProto> public: CIcqProto(const char*, const wchar_t*); ~CIcqProto(); + + CMOption<DWORD> m_dwUin; + CMOption<char*> m_szPassword; }; struct CMPlugin : public ACCPROTOPLUGIN<CIcqProto> diff --git a/protocols/Icq10/src/resource.h b/protocols/Icq10/src/resource.h index ceeaac87fa..f44743d95f 100644 --- a/protocols/Icq10/src/resource.h +++ b/protocols/Icq10/src/resource.h @@ -2,153 +2,18 @@ // Microsoft Visual C++ generated include file. // Used by D:\miranda-ng\protocols\IcqOscarJ\res\resources.rc -#define IDD_ICQACCOUNT 101 -#define IDD_OPT_ICQ 102 -#define IDD_OPT_POPUPS 103 -#define IDC_POPUPS_ENABLED 410 -#define IDC_POPUPS_LOG_ENABLED 411 -#define IDC_POPUPS_SPAM_ENABLED 412 -#define IDC_POPUP_LOG0_TEXTCOLOR 420 -#define IDC_POPUP_LOG1_TEXTCOLOR 421 -#define IDC_POPUP_LOG2_TEXTCOLOR 422 -#define IDC_POPUP_LOG3_TEXTCOLOR 423 -#define IDC_POPUP_SPAM_TEXTCOLOR 425 -#define IDC_POPUP_LOG0_BACKCOLOR 430 -#define IDC_POPUP_LOG1_BACKCOLOR 431 -#define IDC_POPUP_LOG2_BACKCOLOR 432 -#define IDC_POPUP_LOG3_BACKCOLOR 433 -#define IDC_POPUP_SPAM_BACKCOLOR 435 -#define IDC_POPUP_LOG0_TIMEOUT 440 -#define IDC_POPUP_LOG1_TIMEOUT 441 -#define IDC_POPUP_LOG2_TIMEOUT 442 -#define IDC_POPUP_LOG3_TIMEOUT 443 -#define IDC_POPUP_SPAM_TIMEOUT 444 -#define IDC_USEWINCOLORS 450 -#define IDC_USESYSICONS 451 -#define IDC_PREVIEW 455 -#define IDC_SAVEPASS 1004 -#define IDC_RETRXSTATUS 1005 -#define IDC_XTITLE_STATIC 1006 -#define IDC_XMSG_STATIC 1007 -#define IDC_SSL 1008 -#define IDC_MD5LOGIN 1009 -#define IDC_XTITLE 1010 -#define IDC_LEGACY 1010 -#define IDC_KEEPALIVE 1011 -#define IDC_XMSG 1011 -#define IDC_UTFSTATIC 1013 -#define IDC_UTFCODEPAGE 1014 -#define IDC_PW 1015 -#define IDC_TEMPVISIBLE 1015 -#define IDC_REGISTER 1016 -#define IDC_EDITAUTH 1017 -#define IDC_LOGINPW 1018 -#define IDC_INSTRUCTION 1019 -#define IDC_PASSWORD 1020 -#define IDC_SUPTIME 1020 -#define IDC_DCENABLE 1020 -#define IDC_DCPASSIVE 1021 -#define IDC_OLDPASS 1021 -#define IDC_ICQNUM 1022 -#define IDC_USEPOPUPCOLORS 1023 -#define IDC_USEDEFCOLORS 1024 -#define IDC_CLIST 1035 -#define IDC_XSTATUSENABLE 1040 -#define IDC_XSTATUSAUTO 1041 -#define IDC_XSTATUSRESET 1042 -#define IDC_MOODSENABLE 1043 -#define IDC_KILLSPAMBOTS 1045 -#define IDC_EMAIL 1048 -#define IDC_NICK 1053 -#define IDC_GENDER 1060 -#define IDC_CITY 1061 -#define IDC_STATE 1062 -#define IDC_COUNTRY 1063 -#define IDC_COMPANY 1066 -#define IDC_DEPARTMENT 1067 -#define IDC_POSITION 1069 -#define IDC_IP 1094 -#define IDC_UINSTATIC 1122 -#define IDC_UIN 1123 -#define IDC_STATIC11 1154 -#define IDC_STATIC12 1155 -#define IDC_ICQSERVER 1171 -#define IDC_ICQPORT 1172 -#define IDC_VERSION 1179 -#define IDC_FIRSTNAME 1224 -#define IDC_LASTNAME 1225 -#define IDC_REALIP 1230 -#define IDC_RECONNECTREQD 1239 -#define IDC_OFFLINETOENABLE 1240 -#define IDC_PORT 1249 -#define IDC_MIRVER 1251 -#define IDC_ONLINESINCE 1252 -#define IDC_SYSTEMUPTIME 1253 -#define IDC_IDLETIME 1254 -#define IDC_STATUS 1255 -#define IDC_SLOWSEND 1301 -#define IDC_LOGLEVEL 1331 -#define IDC_LEVELDESCR 1332 -#define IDC_NOERRMULTI 1333 -#define IDC_STICQGROUP 1374 -#define IDC_AGERANGE 1410 -#define IDC_MARITALSTATUS 1411 -#define IDC_KEYWORDS 1412 -#define IDC_LANGUAGE 1414 -#define IDC_WORKFIELD 1421 -#define IDC_PASTCAT 1422 -#define IDC_PASTKEY 1423 -#define IDC_INTERESTSCAT 1424 -#define IDC_INTERESTSKEY 1425 -#define IDC_ORGANISATION 1426 -#define IDC_ORGKEYWORDS 1427 -#define IDC_OTHERGROUP 1429 -#define IDC_ONLINEONLY 1430 -#define IDC_HOMEPAGECAT 1431 -#define IDC_HOMEPAGEKEY 1432 -#define IDC_SUMMARYGROUP 1434 -#define IDC_WORKGROUP 1435 -#define IDC_LOCATIONGROUP 1436 -#define IDC_BACKGROUNDGROUP 1437 -#define IDC_NEWUINLINK 1438 -#define IDC_LOOKUPLINK 1439 -#define IDC_RESETSERVER 1472 -#define IDC_UPLOADNOW 1521 -#define IDC_GROUPS 1522 -#define IDC_ALLGROUPS 1526 -#define IDC_VISIBILITY 1527 -#define IDC_IGNORE 1528 -#define IDC_ENABLE 1529 -#define IDC_LOADFROMSERVER 1530 -#define IDC_ADDSERVER 1532 -#define IDC_SAVETOSERVER 1533 -#define IDC_ENABLEAVATARS 1536 -#define IDC_AUTOLOADAVATARS 1537 -#define IDC_STRICTAVATARCHECK 1539 -#define IDC_WEBAWARE 1546 -#define IDC_DCALLOW_ANY 1547 -#define IDC_DCALLOW_CLIST 1548 -#define IDC_DCALLOW_AUTH 1549 -#define IDC_PUBLISHPRIMARY 1550 -#define IDC_ADD_ANY 1551 -#define IDC_ADD_AUTH 1552 -#define IDC_STATUSMSG_CLIST 1553 -#define IDC_STATUSMSG_VISIBLE 1554 -#define IDC_STATIC_NOTONLINE 1555 -#define IDC_STATIC_DC2 1556 -#define IDC_STATIC_DC1 1557 -#define IDC_STATIC_CLIST 1558 -#define IDC_SAVE 1600 -#define IDC_LIST 1601 -#define IDC_UPLOADING 1602 +#define IDD_OPTIONS_FULL 101 +#define IDD_OPTIONS_ACCMGR 102 +#define IDC_PASSWORD 1001 +#define IDC_UIN 1002 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 113 +#define _APS_NEXT_RESOURCE_VALUE 103 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1026 +#define _APS_NEXT_CONTROL_VALUE 1003 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp index e8cf0b0d48..6ad4897cd8 100644 --- a/protocols/Icq10/src/server.cpp +++ b/protocols/Icq10/src/server.cpp @@ -136,18 +136,17 @@ void CIcqProto::OnCheckPassword(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*) m_szAToken = ptrA(mir_urlDecode(m_szAToken)); setString("AToken", m_szAToken); - ptrA szPassword(getStringA("Password")); CMStringA m_szSessionSecret = data["sessionSecret"].as_mstring(); unsigned int len; BYTE hashOut[MIR_SHA256_HASH_SIZE]; - HMAC(EVP_sha256(), szPassword.get(), (int)mir_strlen(szPassword), (BYTE*)m_szSessionSecret.c_str(), m_szSessionSecret.GetLength(), hashOut, &len); + HMAC(EVP_sha256(), m_szPassword, (int)mir_strlen(m_szPassword), (BYTE*)m_szSessionSecret.c_str(), m_szSessionSecret.GetLength(), hashOut, &len); m_szSessionKey = ptrA(mir_base64_encode(hashOut, sizeof(hashOut))); setString("SessionKey", m_szSessionKey); CMStringA szUin = data["loginId"].as_mstring(); if (szUin) - setDword("UIN", atoi(szUin)); + m_dwUin = atoi(szUin); StartSession(); } |