From 5b87c5f200b8b897a1a8c849eb9b9c1e7bb8c5f3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 25 Apr 2018 13:11:15 +0200 Subject: fix for wrong processing of No button in Account Manager --- src/mir_app/src/proto_opts.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 4ed01ec110..208ccb107f 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -448,19 +448,20 @@ public: if (pa == nullptr || pa->bOldProto || pa->bDynDisabled) return; - pa->bIsEnabled = !pa->bIsEnabled; - if (pa->bIsEnabled) + if (!pa->bIsEnabled) { + pa->bIsEnabled = true; ActivateAccount(pa, true); + } else { if (pa->iRealStatus >= ID_STATUS_ONLINE) { wchar_t buf[200]; mir_snwprintf(buf, TranslateT("Account %s is being disabled"), pa->tszAccountName); if (IDNO == ::MessageBox(m_hwnd, TranslateT("Account is online. Disable account?"), buf, MB_ICONWARNING | MB_DEFBUTTON2 | MB_YESNO)) - pa->bIsEnabled = true; // stay enabled + return; // stay enabled } - if (!pa->bIsEnabled) - DeactivateAccount(pa, DAF_DYNAMIC | DAF_FORK); + pa->bIsEnabled = false; + DeactivateAccount(pa, DAF_DYNAMIC | DAF_FORK); } WriteDbAccounts(); -- cgit v1.2.3