From 9613f96e6a6f96ad02a0fc926054132811ae2bb1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Apr 2018 16:30:25 +0300 Subject: Accounts() : iterator for accounts --- plugins/UserInfoEx/src/svc_refreshci.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'plugins/UserInfoEx/src/svc_refreshci.cpp') diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index b409fb78b6..59b991cfb9 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -725,7 +725,6 @@ public: RemoveAll(); ContinueWithNext(); } - }; static CContactUpdater *ContactUpdater = nullptr; @@ -744,15 +743,11 @@ static CContactUpdater *ContactUpdater = nullptr; **/ static BOOL IsMirandaOnline() { - BOOL bIsOnline = FALSE; - PROTOACCOUNT **pAcc; - int nAccCount; - Proto_EnumAccounts(&nAccCount, &pAcc); - - for (int i = 0; (i < nAccCount) && !bIsOnline; i++) - bIsOnline |= (IsProtoAccountEnabled(pAcc[i]) && IsProtoOnline(pAcc[i]->szModuleName)); + for (auto &pa : Accounts()) + if (IsProtoAccountEnabled(pa) && IsProtoOnline(pa->szModuleName)) + return true; - return bIsOnline; + return false; } /*********************************************************************************************************** -- cgit v1.2.3