From 39390b02dbd5aa7eb21a83773fa561b39f8828bc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 20:01:14 +0300 Subject: always hated these long expressions: contact_iter makes them much shorter --- protocols/Steam/src/steam_contacts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/Steam') diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index e3d3c8c9c7..9bdfdc8bf3 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -2,7 +2,7 @@ void CSteamProto::SetAllContactStatuses(int status) { - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) + for (auto &hContact : acc_contact_iter()) SetContactStatus(hContact, status); } @@ -71,7 +71,7 @@ MCONTACT CSteamProto::GetContactFromAuthEvent(MEVENT hEvent) MCONTACT CSteamProto::GetContact(const char *steamId) { - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { ptrA cSteamId(getStringA(hContact, "SteamID")); if (!mir_strcmp(cSteamId, steamId)) return hContact; @@ -428,7 +428,7 @@ void CSteamProto::OnGotFriendList(const JSONNode &root, void*) } // Check and update contacts in database - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { ptrA steamId(getStringA(hContact, "SteamID")); if (steamId == nullptr) continue; -- cgit v1.2.3