summaryrefslogtreecommitdiff
path: root/protocols/Teams/src/teams_options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Teams/src/teams_options.cpp')
-rw-r--r--protocols/Teams/src/teams_options.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/protocols/Teams/src/teams_options.cpp b/protocols/Teams/src/teams_options.cpp
index 6191f15a41..040583ad85 100644
--- a/protocols/Teams/src/teams_options.cpp
+++ b/protocols/Teams/src/teams_options.cpp
@@ -19,61 +19,38 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class COptionsMainDlg : public CTeamsDlgBase
{
- CCtrlEdit m_login, m_password, m_group, m_place;
+ CCtrlEdit m_login, m_group;
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_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%
+ m_usebb(this, IDC_BBCODES)
{
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(DBKEY_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);
return true;
}
bool OnApply() override
{
- ptrA szNewSkypename(m_login.GetTextA()),
- szOldSkypename(m_proto->getStringA(DBKEY_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(DBKEY_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());
- }
};
/////////////////////////////////////////////////////////////////////////////////