mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
Update chat frontend to better handle incoming messages
When an incoming message occurs from somebody who is new, a new chat contact is spawned and put into the contact list.
This commit is contained in:
@@ -145,7 +145,7 @@ var db = require('./database'),
|
||||
};
|
||||
|
||||
function getMessages(mids, fromuid, touid, isNew, callback) {
|
||||
user.getMultipleUserFields([fromuid, touid], ['uid', 'username', 'userslug', 'picture'], function(err, userData) {
|
||||
user.getMultipleUserFields([fromuid, touid], ['uid', 'username', 'userslug', 'picture', 'status'], function(err, userData) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -168,6 +168,7 @@ var db = require('./database'),
|
||||
|
||||
Messaging.parse(message.content, message.fromuid, fromuid, userData[1], userData[0], isNew, function(result) {
|
||||
message.content = result;
|
||||
message.cleanedContent = S(result).stripTags().decodeHTMLEntities().s;
|
||||
next(null, message);
|
||||
});
|
||||
}, next);
|
||||
|
||||
Reference in New Issue
Block a user