diff options
Diffstat (limited to 'protocols/ICQ-WIM/src')
| -rw-r--r-- | protocols/ICQ-WIM/src/options.cpp | 4 | ||||
| -rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 3 | ||||
| -rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 1 | ||||
| -rw-r--r-- | protocols/ICQ-WIM/src/resource.h | 4 | ||||
| -rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 7 |
5 files changed, 14 insertions, 5 deletions
diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp index 1c94b55b15..13307d8d02 100644 --- a/protocols/ICQ-WIM/src/options.cpp +++ b/protocols/ICQ-WIM/src/options.cpp @@ -154,7 +154,7 @@ void CIcqProto::OnLoginViaPhone(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pRe class CIcqOptionsDlg : public CProtoDlgBase<CIcqProto> { - CCtrlEdit edtUin, edtPassword; + CCtrlEdit edtUin, edtEmail, edtPassword; CCtrlCheck chkHideChats; CCtrlButton btnCreate; CMStringW wszOldPass; @@ -163,6 +163,7 @@ public: CIcqOptionsDlg(CIcqProto *ppro, int iDlgID, bool bFullDlg) : CProtoDlgBase<CIcqProto>(ppro, iDlgID), edtUin(this, IDC_UIN), + edtEmail(this, IDC_EMAIL), btnCreate(this, IDC_REGISTER), edtPassword(this, IDC_PASSWORD), chkHideChats(this, IDC_HIDECHATS) @@ -170,6 +171,7 @@ public: btnCreate.OnClick = Callback(this, &CIcqOptionsDlg::onClick_Register); CreateLink(edtUin, ppro->m_dwUin); + CreateLink(edtEmail, ppro->m_szEmail); CreateLink(edtPassword, ppro->m_szPassword); if (bFullDlg) CreateLink(chkHideChats, ppro->m_bHideGroupchats); diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 6de8c1e60d..3520584a24 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -41,6 +41,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) : arMarkReadQueue(10, NumericKeySortT), m_evRequestsQueue(CreateEvent(nullptr, FALSE, FALSE, nullptr)), m_dwUin(this, DB_KEY_UIN, 0), + m_szEmail(this, "Email"), m_szPassword(this, "Password"), m_bHideGroupchats(this, "HideChats", 1) { @@ -435,7 +436,7 @@ int CIcqProto::SetStatus(int iNewStatus) m_iStatus = ID_STATUS_CONNECTING; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus); - if (m_dwUin == 0) { + if (m_dwUin == 0 && mir_wstrlen(m_szEmail) == 0) { debugLogA("Thread ended, UIN/password are not configured"); ConnectionFailed(LOGINERR_BADUSERID); return 0; diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 68619e2a6c..827718e03e 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -302,6 +302,7 @@ public: ~CIcqProto(); CMOption<DWORD> m_dwUin; // our own id + CMOption<wchar_t*> m_szEmail; // email, if present CMOption<wchar_t*> m_szPassword; // password, if present CMOption<BYTE> m_bHideGroupchats; // don't pop up group chat windows on startup diff --git a/protocols/ICQ-WIM/src/resource.h b/protocols/ICQ-WIM/src/resource.h index e8bede4085..7af9c260d7 100644 --- a/protocols/ICQ-WIM/src/resource.h +++ b/protocols/ICQ-WIM/src/resource.h @@ -9,6 +9,7 @@ #define IDD_REGISTER 105 #define IDC_PASSWORD 1001 #define IDC_UIN 1002 +#define IDC_UIN2 1003 #define IDC_HIDECHATS 1004 #define IDC_REGISTER 1005 #define IDC_PHONE 1006 @@ -21,6 +22,7 @@ #define IDC_IDLETIME2 1013 #define IDC_MEMBERSINCE 1013 #define IDC_LASTSEEN 1014 +#define IDC_EMAIL 1015 // Next default values for new objects // @@ -28,7 +30,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 108 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1013 +#define _APS_NEXT_CONTROL_VALUE 1016 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index d39f2bfac9..5c6ec298ae 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -80,13 +80,17 @@ void CIcqProto::CheckPassword() char mirVer[100]; Miranda_GetVersionText(mirVer, _countof(mirVer)); + CMStringW wszId(m_szEmail); + if (wszId.IsEmpty()) + wszId.Format(L"%d", (DWORD)m_dwUin); + m_szAToken = getMStringA(DB_KEY_ATOKEN); m_iRClientId = getDword(DB_KEY_RCLIENTID); m_szSessionKey = getMStringA(DB_KEY_SESSIONKEY); 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", m_dwUin) << WCHAR_PARAM("pwd", m_szPassword); + << CHAR_PARAM("f", "json") << CHAR_PARAM("tokenType", "longTerm") << WCHAR_PARAM("s", wszId) << WCHAR_PARAM("pwd", m_szPassword); pReq->flags |= NLHRF_NODUMPSEND; Push(pReq); } @@ -184,7 +188,6 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) Json2string(hContact, buddy, "cellNumber", "Cellular"); Json2string(hContact, buddy, "phoneNumber", "Phone"); Json2string(hContact, buddy, "workNumber", "CompanyPhone"); - Json2string(hContact, buddy, "emailId", "e-mail"); // zero here means that a contact is currently online int lastSeen = buddy["lastseen"].as_int(); |
