summaryrefslogtreecommitdiff
path: root/plugins/ListeningTo
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 /plugins/ListeningTo
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/ListeningTo')
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 6233fae662..79ba940b61 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -220,13 +220,9 @@ int ModulesLoaded(WPARAM, LPARAM)
proto_items[0].old_xstatus_message[0] = '\0';
// Add each proto
- PROTOACCOUNT **protos;
- int count;
- Proto_EnumAccounts(&count, &protos);
-
- for (int i = 0; i < count; i++)
- if (protos[i]->bIsEnabled)
- RegisterProtocol(protos[i]->szModuleName, protos[i]->tszAccountName);
+ for (auto &pa : Accounts())
+ if (pa->bIsEnabled)
+ RegisterProtocol(pa->szModuleName, pa->tszAccountName);
HookEvent(ME_PROTO_ACCLISTCHANGED, AccListChanged);