summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src/commonstatus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/StatusManager/src/commonstatus.cpp')
-rw-r--r--plugins/StatusManager/src/commonstatus.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/StatusManager/src/commonstatus.cpp b/plugins/StatusManager/src/commonstatus.cpp
index c8ce7d10b7..7e83949b55 100644
--- a/plugins/StatusManager/src/commonstatus.cpp
+++ b/plugins/StatusManager/src/commonstatus.cpp
@@ -251,9 +251,8 @@ int SetStatusEx(TProtoSettings &ps)
// status checks
long protoFlag = Proto_Status2Flag(newstatus);
- int b_Caps2 = CallProtoService(p->m_szName, PS_GETCAPS, PFLAGNUM_2, 0) & protoFlag;
- int b_Caps5 = CallProtoService(p->m_szName, PS_GETCAPS, PFLAGNUM_5, 0) & protoFlag;
- if (newstatus != ID_STATUS_OFFLINE && (!b_Caps2 || b_Caps5)) {
+ int b_Caps25 = GetStatusFlags(p->m_szName) & protoFlag;
+ if (newstatus != ID_STATUS_OFFLINE && !b_Caps25) {
// status and status message for this status not supported
log_debug(0, "CommonStatus: status not supported %s", p->m_szName);
continue;
@@ -297,6 +296,15 @@ static INT_PTR GetProtocolCountService(WPARAM, LPARAM)
return pCount;
}
+int GetStatusFlags(const char *szProto)
+{
+ int flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_5, 0);
+ if (flags == 0)
+ flags = PF2_ONLINE;
+
+ return flags;
+}
+
bool IsSuitableProto(PROTOACCOUNT *pa)
{
if (!pa || !pa->bIsVisible || !pa->IsEnabled() || !pa->ppro)