summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/chat.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-04 15:09:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-04 15:09:01 +0300
commit823e3839b108658811f689f959f51058effd82ac (patch)
treeb65b8618fb5c61c7e73cf8c0204cbd961a6b08c9 /protocols/FacebookRM/src/chat.cpp
parentd3f84250fdaa48e0ca1032b92b9c0f827707655b (diff)
ะก++'11 scope for's are suddenly more effective...
Diffstat (limited to 'protocols/FacebookRM/src/chat.cpp')
-rw-r--r--protocols/FacebookRM/src/chat.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp
index 335b9e281a..7b5a0d7935 100644
--- a/protocols/FacebookRM/src/chat.cpp
+++ b/protocols/FacebookRM/src/chat.cpp
@@ -260,8 +260,8 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM)
AddChat(fbc->thread_id.c_str(), fbc->chat_name.c_str());
// Add chat contacts
- for (std::map<std::string, chatroom_participant>::iterator jt = fbc->participants.begin(); jt != fbc->participants.end(); ++jt)
- AddChatContact(fbc->thread_id.c_str(), jt->second, false);
+ for (auto &jt : fbc->participants)
+ AddChatContact(fbc->thread_id.c_str(), jt.second, false);
// Load last messages
delSetting(hContact, FACEBOOK_KEY_MESSAGE_ID); // We're creating new chatroom so we want load all recent messages
@@ -393,11 +393,11 @@ std::string FacebookProto::GenerateChatName(facebook_chatroom *fbc)
std::string name = "";
unsigned int namesUsed = 0;
- for (auto it = fbc->participants.begin(); it != fbc->participants.end(); ++it) {
- std::string participant = it->second.nick;
+ for (auto &it : fbc->participants) {
+ std::string participant = it.second.nick;
// Ignore self contact, empty and numeric only participant names
- if (it->second.role == ROLE_ME || participant.empty() || participant.find_first_not_of("0123456789") == std::string::npos)
+ if (it.second.role == ROLE_ME || participant.empty() || participant.find_first_not_of("0123456789") == std::string::npos)
continue;
if (namesUsed > 0)