Attach client to chat messages (#10845)

* Attach client to chat messages

* Word

* Design tweaks

* Fix potential error
This commit is contained in:
Phillip Thelen
2018-11-26 10:45:42 +01:00
parent 03763f46c9
commit aac23f30cf
4 changed files with 12 additions and 5 deletions

View File

@@ -177,7 +177,11 @@ api.postChat = {
}
const message = await highlightMentions(req.body.message);
const newChatMessage = group.sendChat(message, user);
let client = req.headers['x-client'] || '3rd Party';
if (client) {
client = client.replace('habitica-', '');
}
const newChatMessage = group.sendChat(message, user, null, client);
let toSave = [newChatMessage.save()];
if (group.type === 'party') {