SYWEB-22: Format emote('/me') messages correctly in desktop notification
parent
b6818fd4d2
commit
65c37cc852
|
@ -200,11 +200,17 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
|
||||||
if (member) {
|
if (member) {
|
||||||
displayname = member.displayname;
|
displayname = member.displayname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var message = event.content.body;
|
||||||
|
if (event.content.msgtype === "m.emote") {
|
||||||
|
message = "* " + displayname + " " + message;
|
||||||
|
}
|
||||||
|
|
||||||
var notification = new window.Notification(
|
var notification = new window.Notification(
|
||||||
(displayname || event.user_id) +
|
(displayname || event.user_id) +
|
||||||
" (" + (matrixService.getRoomIdToAliasMapping(event.room_id) || event.room_id) + ")", // FIXME: don't leak room_ids here
|
" (" + (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
|
"icon": member ? member.avatar_url : undefined
|
||||||
});
|
});
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
Loading…
Reference in New Issue