From 7950cd0b91e0c5ffcf97f62378542822cea2ad37 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 23 Apr 2018 19:26:32 +0300 Subject: account's icon remains red after dynamic protocol loading --- src/mir_app/src/pluginopts.cpp | 13 +++++++++---- src/mir_app/src/proto_opts.cpp | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 0bddc0f6f4..f2730dcfaa 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -189,10 +189,15 @@ static bool LoadPluginDynamically(PluginListItemData *dat) if (pd->hInst != pPlug->bpi.hInst) continue; - for (auto &pa : accounts) - if (pa->ppro == nullptr && !mir_strcmp(pa->szProtoName, pd->szName) && pa->bIsEnabled) - if (ActivateAccount(pa, true)) - NotifyEventHooks(hAccListChanged, PRAC_ADDED, (LPARAM)pa); + for (auto &pa : accounts) { + if (pa->ppro == nullptr && !mir_strcmp(pa->szProtoName, pd->szName)) { + if (pa->bIsEnabled) { + if (ActivateAccount(pa, true)) + NotifyEventHooks(hAccListChanged, PRAC_ADDED, (LPARAM)pa); + } + else pa->bDynDisabled = false; + } + } } dat->hInst = pPlug->bpi.hInst; diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index e8f76ad3f0..4ed01ec110 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -456,7 +456,7 @@ public: 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 = 1; // stay enabled + pa->bIsEnabled = true; // stay enabled } if (!pa->bIsEnabled) -- cgit v1.2.3