SYWEB-22: Format emote('/me') messages correctly in desktop notification

This commit is contained in:
Emmanuel ROHEE 2014-09-17 16:12:55 +02:00
parent b6818fd4d2
commit 65c37cc852

View file

@ -200,11 +200,17 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
if (member) {
displayname = member.displayname;
}
var message = event.content.body;
if (event.content.msgtype === "m.emote") {
message = "* " + displayname + " " + message;
}
var notification = new window.Notification(
(displayname || event.user_id) +
" (" + (matrixService.getRoomIdToAliasMapping(event.room_id) || event.room_id) + ")", // FIXME: don't leak room_ids here
{
"body": event.content.body,
"body": message,
"icon": member ? member.avatar_url : undefined
});
$timeout(function() {