summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/process.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-03-05 15:05:51 +0100
committerRobert Pösel <robyer@seznam.cz>2017-03-05 15:06:02 +0100
commitda611f505c0e9a8d8476de272967891efba48872 (patch)
tree9c3b2ea1ca752b9a3628748fafa6cd78dbb0b101 /protocols/FacebookRM/src/process.cpp
parent5417b1e4a79c86ac64cb3f84cde17eec2e0d0c87 (diff)
Facebook: Fix reseting chat name
When user changed thread name from website and set it to "", in Miranda it previously stay "". Now it correctly generates new name from participant names.
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r--protocols/FacebookRM/src/process.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 6497145c00..4bc3867d0b 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -878,11 +878,14 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo
}
}
break;
- case THREAD_NAME:
- // proto->RenameChat(thread_id.c_str(), msg.data.c_str()); // this don't work, why?
- setStringUtf(hChatContact, FACEBOOK_KEY_NICK, msg.data.c_str());
+ case THREAD_NAME: {
UpdateChat(thread_id.c_str(), NULL, NULL, msg.message_text.c_str());
+
+ std::string chatName = (!msg.data.empty() ? msg.data : GenerateChatName(fbc));
+ // proto->RenameChat(thread_id.c_str(), chatName.c_str()); // this don't work, why?
+ setStringUtf(hChatContact, FACEBOOK_KEY_NICK, chatName.c_str());
break;
+ }
case THREAD_IMAGE:
UpdateChat(thread_id.c_str(), NULL, NULL, msg.message_text.c_str());
break;