summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-02-12 16:34:45 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-02-12 16:34:45 +0300
commit0b0cecd7ce5fa91f6110f0219c58e1b2ec0c29ea (patch)
tree201ca2e07358757fcabb19055b7cb8e5d02a287b /plugins/StatusManager/src
parent4076a82151877a1666edeb094826fc99da4bf234 (diff)
Status plugins to handle hidden but active protocols
Diffstat (limited to 'plugins/StatusManager/src')
-rw-r--r--plugins/StatusManager/src/commonstatus.cpp6
-rw-r--r--plugins/StatusManager/src/ss_options.cpp22
2 files changed, 18 insertions, 10 deletions
diff --git a/plugins/StatusManager/src/commonstatus.cpp b/plugins/StatusManager/src/commonstatus.cpp
index f0ffb071b6..c8ce7d10b7 100644
--- a/plugins/StatusManager/src/commonstatus.cpp
+++ b/plugins/StatusManager/src/commonstatus.cpp
@@ -299,7 +299,11 @@ static INT_PTR GetProtocolCountService(WPARAM, LPARAM)
bool IsSuitableProto(PROTOACCOUNT *pa)
{
- return (pa == nullptr) ? false : pa->IsVisible();
+ if (!pa || !pa->bIsVisible || !pa->IsEnabled() || !pa->ppro)
+ return false;
+
+ PROTOCOLDESCRIPTOR *pd = Proto_IsProtocolLoaded(pa->szProtoName);
+ return (pd != nullptr && (pd->type == PROTOTYPE_PROTOCOL || pd->type == PROTOTYPE_PROTOWITHACCS));
}
static int onShutdown(WPARAM, LPARAM)
diff --git a/plugins/StatusManager/src/ss_options.cpp b/plugins/StatusManager/src/ss_options.cpp
index 3f9e37d69b..4faef91bd1 100644
--- a/plugins/StatusManager/src/ss_options.cpp
+++ b/plugins/StatusManager/src/ss_options.cpp
@@ -531,18 +531,19 @@ class CSSAdvancedOptDlg : public CDlgBase
void SetProfile()
{
int sel = cmbProfile.GetCurData();
- chkCreateTTB.SetState(arProfiles[sel].createTtb);
- chkShowDialog.SetState(arProfiles[sel].showDialog);
- chkCreateMMI.SetState(arProfiles[sel].createMmi);
- chkInSubmenu.SetState(arProfiles[sel].inSubMenu);
- chkInSubmenu.Enable(arProfiles[sel].createMmi);
- chkRegHotkey.SetState(arProfiles[sel].regHotkey);
- edtHotkey.SendMsg(HKM_SETHOTKEY, arProfiles[sel].hotKey, 0);
- edtHotkey.Enable(arProfiles[sel].regHotkey);
+ auto &P = arProfiles[sel];
+ chkCreateTTB.SetState(P.createTtb);
+ chkShowDialog.SetState(P.showDialog);
+ chkCreateMMI.SetState(P.createMmi);
+ chkInSubmenu.SetState(P.inSubMenu);
+ chkInSubmenu.Enable(P.createMmi);
+ chkRegHotkey.SetState(P.regHotkey);
+ edtHotkey.SendMsg(HKM_SETHOTKEY, P.hotKey, 0);
+ edtHotkey.Enable(P.regHotkey);
// fill proto list
lstAccount.ResetContent();
- for (auto &it : arProfiles[sel].ps)
+ for (auto &it : P.ps)
lstAccount.AddString(it->m_tszAccName, (LPARAM)it);
lstAccount.SetCurSel(0);
@@ -557,6 +558,9 @@ class CSSAdvancedOptDlg : public CDlgBase
SMProto* ps = (SMProto*)lstAccount.GetItemData(idx);
int flags = (CallProtoService(ps->m_szName, PS_GETCAPS, PFLAGNUM_2, 0))&~(CallProtoService(ps->m_szName, PS_GETCAPS, PFLAGNUM_5, 0));
+ if (flags == 0)
+ flags = PF2_ONLINE;
+
lstStatus.ResetContent();
for (auto &it : statusModes) {
if ((flags & it.iFlag) || (it.iStatus == ID_STATUS_OFFLINE)) {