diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-03-30 20:04:12 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-03-30 20:04:12 +0300 |
| commit | 351a4ae54f9d6e2c1a5b9a6dee08961fbb51e92a (patch) | |
| tree | 8c0416992e12074612afdf86d33e2c5f85f51bba /protocols/Teams/src/teams_options.cpp | |
| parent | 5b036d1ae27b1ab12623778fec0aa90b239496c6 (diff) | |
Teams: synced with existing Skype code base
Diffstat (limited to 'protocols/Teams/src/teams_options.cpp')
| -rw-r--r-- | protocols/Teams/src/teams_options.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/protocols/Teams/src/teams_options.cpp b/protocols/Teams/src/teams_options.cpp index 260368dfc5..e5334a0985 100644 --- a/protocols/Teams/src/teams_options.cpp +++ b/protocols/Teams/src/teams_options.cpp @@ -19,22 +19,35 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class COptionsMainDlg : public CTeamsDlgBase { - CCtrlEdit m_login, m_password, m_group; + CCtrlEdit m_login, m_password, m_group, m_place; + CCtrlCheck m_autosync, m_usehostname, m_usebb; + CCtrlHyperlink m_link; public: COptionsMainDlg(CTeamsProto *proto, int idDialog) : CTeamsDlgBase(proto, idDialog), m_login(this, IDC_LOGIN), m_password(this, IDC_PASSWORD), - m_group(this, IDC_GROUP) + m_group(this, IDC_GROUP), + m_place(this, IDC_PLACE), + m_autosync(this, IDC_AUTOSYNC), + m_usehostname(this, IDC_USEHOST), + m_usebb(this, IDC_BBCODES), + m_link(this, IDC_CHANGEPASS, "https://login.skype.com/recovery/password-change") // TODO : ...?username=%username% { CreateLink(m_group, proto->m_wstrCListGroup); + CreateLink(m_autosync, proto->m_bAutoHistorySync); + CreateLink(m_place, proto->m_wstrPlace); + CreateLink(m_usehostname, proto->m_bUseHostnameAsPlace); + CreateLink(m_usebb, proto->m_bUseBBCodes); + m_usehostname.OnChange = Callback(this, &COptionsMainDlg::OnUsehostnameCheck); } bool OnInitDialog() override { - m_login.SetTextA(ptrA(m_proto->getStringA("Login"))); + m_login.SetTextA(ptrA(m_proto->getStringA(SKYPE_SETTINGS_ID))); m_password.SetTextA(pass_ptrA(m_proto->getStringA("Password"))); + m_place.Enable(!m_proto->m_bUseHostnameAsPlace); m_login.SendMsg(EM_LIMITTEXT, 128, 0); m_password.SendMsg(EM_LIMITTEXT, 128, 0); m_group.SendMsg(EM_LIMITTEXT, 64, 0); @@ -43,17 +56,27 @@ public: bool OnApply() override { - m_proto->setString("Login", ptrA(m_login.GetTextA())); - m_proto->setString("Password", ptrA(m_password.GetTextA())); + ptrA szNewSkypename(m_login.GetTextA()), + szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID)); + pass_ptrA szNewPassword(m_password.GetTextA()), + szOldPassword(m_proto->getStringA("Password")); + if (mir_strcmpi(szNewSkypename, szOldSkypename) || mir_strcmp(szNewPassword, szOldPassword)) + m_proto->delSetting("TokenExpiresIn"); + m_proto->setString(SKYPE_SETTINGS_ID, szNewSkypename); + m_proto->setString("Password", szNewPassword); ptrW group(m_group.GetText()); if (mir_wstrlen(group) > 0 && !Clist_GroupExists(group)) Clist_GroupCreate(0, group); return true; } + + void OnUsehostnameCheck(CCtrlCheck *) + { + m_place.Enable(!m_usehostname.GetState()); + } }; ///////////////////////////////////////////////////////////////////////////////// -// module entry points MWindow CTeamsProto::OnCreateAccMgrUI(MWindow hwndParent) { @@ -76,5 +99,3 @@ int CTeamsProto::OnOptionsInit(WPARAM wParam, LPARAM) return 0; } - - |
