From f594c8c321533e59d66e7d47ab1a3cdbf551ad90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Mon, 25 Jul 2016 19:20:52 +0000 Subject: Facebook: Improve loading users in chatrooms Fix loading all names (previously it won't loaded name of last user), load also former participants, code refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@17129 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/communication.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'protocols/FacebookRM/src/communication.cpp') diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 21ff44d15d..486bc08696 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -714,18 +714,12 @@ void facebook_client::insert_reader(MCONTACT hContact, time_t timestamp, const s auto itRoom = chat_rooms.find(tid); if (itRoom != chat_rooms.end()) { facebook_chatroom *chatroom = itRoom->second; - std::map participants = chatroom->participants; + std::map participants = chatroom->participants; // try to get name of this participant auto participant = participants.find(readerId); if (participant != participants.end()) { - name = participant->second; - } - else { - // FIXME: This probably shouldn't be here, but chatroom should have all it's participants loaded itself already - // add this missing participant, just in case - participants.insert(std::make_pair(readerId, name)); - parent->AddChatContact(tid.c_str(), readerId.c_str(), name.c_str()); + name = participant->second.nick; } } -- cgit v1.2.3