diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-04-17 17:06:32 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-04-17 17:06:32 +0000 |
commit | 217cefab79fe09de8911fa3e94ff8c2fa6014a55 (patch) | |
tree | a4ad900cab4aada45c82299862f654f58ef0dd76 /protocols/FacebookRM/src/process.cpp | |
parent | 9e64b26c646913d5669723269c07e6fe8277f10c (diff) |
Facebook: Remove useless sender_name field
git-svn-id: http://svn.miranda-ng.org/main/trunk@16702 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 27383e09f1..ae521345a9 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -919,15 +919,17 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message*> messages, boo if (!tid || mir_strcmp(tid, messages[i]->thread_id.c_str())) setString(hChatContact, FACEBOOK_KEY_TID, messages[i]->thread_id.c_str()); - // Try to map name of this chat participant to his id - std::map<std::string, std::string>::iterator jt = fbc->participants.find(messages[i]->user_id); + // Get name of this chat participant + std::string name = messages[i]->user_id; // fallback to numeric id + + auto jt = fbc->participants.find(messages[i]->user_id); if (jt != fbc->participants.end()) { - messages[i]->sender_name = jt->second; + name = jt->second; } // TODO: support also system messages (rename chat, user quit, etc.)! (here? or it is somewhere else? // ... we must add some new "type" field into facebook_message structure and use it also for Pokes and similar) - UpdateChat(fbc->thread_id.c_str(), messages[i]->user_id.c_str(), messages[i]->sender_name.c_str(), messages[i]->message_text.c_str(), messages[i]->time); + UpdateChat(fbc->thread_id.c_str(), messages[i]->user_id.c_str(), name.c_str(), messages[i]->message_text.c_str(), messages[i]->time); // Automatically mark message as read because chatroom doesn't support onRead event (yet) hChatContacts->insert(hChatContact); // std::set checks duplicates at insert automatically @@ -938,7 +940,6 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message*> messages, boo facebook_user fbu; fbu.user_id = messages[i]->user_id; - fbu.real_name = messages[i]->sender_name; MCONTACT hContact = ContactIDToHContact(fbu.user_id); if (hContact == NULL) { |