diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
commit | 39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch) | |
tree | 7982eda1257f7466b5663c2865fdb7804c397257 /protocols/FacebookRM/src | |
parent | 5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff) |
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 266818d1af..565f434872 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -500,7 +500,7 @@ void FacebookProto::LoadParticipantsNames(facebook_chatroom *fbc) void FacebookProto::JoinChatrooms() { - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (!isChatRoom(hContact)) continue; diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index be4c056871..889b042fa3 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -90,7 +90,7 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::string &chat_id) } // Go through all local contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (!IsMyContact(hContact, true)) continue; @@ -122,7 +122,7 @@ MCONTACT FacebookProto::ContactIDToHContact(const std::string &user_id) } // Go through all local contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (isChatRoom(hContact)) continue; @@ -150,7 +150,7 @@ std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id) } // Go through all local contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (!IsMyContact(hContact)) continue; diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 4455126c61..a30cdbbf6c 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -50,7 +50,7 @@ void FacebookProto::ProcessFriendList(void*) ParseFriends(&resp.data, &friends, loadAllContacts); // Check and update old contacts - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (auto &hContact : acc_contact_iter()) { if (isChatRoom(hContact)) continue; |