summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp9
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;
}