summaryrefslogtreecommitdiff
path: root/protocols/Steam
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
commit39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch)
tree7982eda1257f7466b5663c2865fdb7804c397257 /protocols/Steam
parent5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff)
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'protocols/Steam')
-rw-r--r--protocols/Steam/src/steam_contacts.cpp6
1 files changed, 3 insertions, 3 deletions
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;