Commit 4a806a6d authored by Killian Kemps's avatar Killian Kemps

Temporary fix empty messages diplay in conversation

These messages are events like nickname change.
The permanent fix will come from the facebook-chat-api library
Related issue: https://github.com/Schmavery/facebook-chat-api/issues/313
parent e17f0345
......@@ -176,8 +176,13 @@ function getFBThreadHistory(decoded, users, socket, threadID) {
return new Promise(function (resolve, reject) {
currentUser.fbApi.getThreadHistory(threadID, 0, 10, '', function (err, data) {
if(err) return console.error(err);
socket.emit('return/threadHistory', data);
resolve(data);
// XXX Temporary fix to remove events from messages
// Permament fix is related to this issue: https://github.com/Schmavery/facebook-chat-api/issues/313
const filtered_data = data.filter(function(msg) {
return msg.body || msg.attachments.length > 0;
});
socket.emit('return/threadHistory', filtered_data);
resolve(filtered_data);
});
});
})().catch(function(err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment