mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-09 13:11:52 +00:00
SYWEB-22: Format emote('/me') messages correctly in desktop notification
This commit is contained in:
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
Block a user