diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
commit | 9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch) | |
tree | f8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/ZeroNotification/src/main.cpp | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/ZeroNotification/src/main.cpp')
-rw-r--r-- | plugins/ZeroNotification/src/main.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 172b961d8e..66ca7a1903 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -113,17 +113,12 @@ static int SetNotify(const long status) //Called whenever a change in status is detected
static int ProtoAck(WPARAM, LPARAM lParam)
{
+ // quit if not status event
ACKDATA *ack = (ACKDATA*)lParam;
- PROTOACCOUNT **protos;
-
- //quit if not status event
if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) {
long status = 0;
- int count;
- Proto_EnumAccounts(&count, &protos);
-
- for (int i = 0; i < count; i++)
- status = status | Proto_Status2Flag(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0));
+ for (auto &pa : Accounts())
+ status = status | Proto_Status2Flag(CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
SetNotify(status);
}
|