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/ZeroNotification/src/main.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'plugins/ZeroNotification/src/main.cpp') 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); } -- cgit v1.2.3