summaryrefslogtreecommitdiff
path: root/src/core/stduseronline
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
commit9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch)
treef8fe94a3efe7598a2af926f264d354f7a08fb943 /src/core/stduseronline
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'src/core/stduseronline')
-rw-r--r--src/core/stduseronline/src/useronline.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp
index 2a3c16d49f..ab01edd77a 100644
--- a/src/core/stduseronline/src/useronline.cpp
+++ b/src/core/stduseronline/src/useronline.cpp
@@ -84,14 +84,9 @@ static int UserOnlineAck(WPARAM, LPARAM lParam)
static int UserOnlineModulesLoaded(WPARAM, LPARAM)
{
- int numAccounts;
- PROTOACCOUNT** accounts;
- Proto_EnumAccounts(&numAccounts, &accounts);
-
- // reset the counter
- for (int i = 0; i < numAccounts; i++)
- if (accounts[i]->IsEnabled())
- db_set_dw(NULL, "UserOnline", accounts[i]->szModuleName, GetTickCount());
+ for (auto &pa : Accounts())
+ if (pa->IsEnabled())
+ db_set_dw(NULL, "UserOnline", pa->szModuleName, GetTickCount());
return 0;
}