diff options
author | George Hazan <ghazan@miranda.im> | 2021-06-10 18:46:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-06-10 18:46:29 +0300 |
commit | c677ad260e08dd06946cb48e928509cef4701504 (patch) | |
tree | d213eb2fc0a7e9f267999c1905de7453c0f8beec | |
parent | 686c8681b6d46ec92bdbf2463307e2cd88b3d31b (diff) |
fixes #2903 (dynamic loading/unloading doesn't work for old protocols)
-rw-r--r-- | src/mir_app/src/pluginopts.cpp | 7 | ||||
-rw-r--r-- | src/mir_app/src/protocols.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 2e5b87960f..2e0bf8453e 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -227,13 +227,18 @@ static bool LoadPluginDynamically(PluginListItemData *dat) continue;
for (auto &pa : g_arAccounts) {
- if (pa->ppro == nullptr && !mir_strcmp(pa->szProtoName, pd->szName)) {
+ if (mir_strcmp(pa->szProtoName, pd->szName))
+ continue;
+
+ if (pa->ppro == nullptr) {
if (pa->bIsEnabled) {
if (ActivateAccount(pa, true))
NotifyEventHooks(hAccListChanged, PRAC_ADDED, (LPARAM)pa);
}
else pa->bDynDisabled = false;
}
+ else if (pa->bOldProto)
+ NotifyEventHooks(hAccListChanged, PRAC_ADDED, (LPARAM)pa);
}
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 87be16993b..fcd5a42ddc 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -339,7 +339,7 @@ PROTOACCOUNT::~PROTOACCOUNT() bool PROTOACCOUNT::IsEnabled() const
{
- return (this != nullptr) && ((bIsEnabled && !bDynDisabled) || bOldProto);
+ return (this != nullptr) && (bIsEnabled && !bDynDisabled);
}
bool PROTOACCOUNT::IsLocked() const
|