summaryrefslogtreecommitdiff
path: root/plugins/ZeroNotification/src/main.cpp
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/ZeroNotification/src/main.cpp
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/ZeroNotification/src/main.cpp')
-rw-r--r--plugins/ZeroNotification/src/main.cpp11
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);
}