From aca2b7d470e7dcbf605d07249419c0303f8e67f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 11 Sep 2016 21:36:02 +0000 Subject: 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 --- protocols/FacebookRM/src/contacts.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'protocols/FacebookRM/src') 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; } -- cgit v1.2.3