diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-09-11 21:36:02 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-09-11 21:36:02 +0000 |
commit | aca2b7d470e7dcbf605d07249419c0303f8e67f9 (patch) | |
tree | f705e79c78ee5681cb45af917fb8bc7a0b802bee | |
parent | 8f80c889930ed652ad96b0bd494abee1116a2a86 (diff) |
Facebook: When generating group chat name, don't include ourself
git-svn-id: http://svn.miranda-ng.org/main/trunk@17286 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 3a51a2bb86..36d2536f92 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -351,8 +351,8 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc) for (auto it = fbc->participants.begin(); it != fbc->participants.end(); ++it) { std::string participant = it->second.nick; - // Ignore empty and numeric only participant names - if (participant.empty() || participant.find_first_not_of("0123456789") == std::string::npos) + // 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) continue; if (namesUsed > 0) @@ -365,9 +365,10 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc) break; } - if (fbc->participants.size() > namesUsed) { + // Participants.size()-1 because we ignore self contact + if (fbc->participants.size() - 1 > namesUsed) { wchar_t more[200]; - mir_snwprintf(more, TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - namesUsed); + mir_snwprintf(more, TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - 1 - namesUsed); // -1 because we ignore self contact fbc->chat_name = more; } |