diff options
author | Emmanuel ROHEE <erohee@amdocs.com> | 2014-09-17 16:12:55 +0200 |
---|---|---|
committer | Emmanuel ROHEE <erohee@amdocs.com> | 2014-09-17 16:13:09 +0200 |
commit | 65c37cc85213c919add2b3fa9ac107edd869df2d (patch) | |
tree | a70c1ca82f886277141d8f69af52e37cb8e73a8c /webclient/components | |
parent | SYN-40: When a user updates their displayname or avatar update all their join... (diff) | |
download | synapse-65c37cc85213c919add2b3fa9ac107edd869df2d.tar.xz |
SYWEB-22: Format emote('/me') messages correctly in desktop notification
Diffstat (limited to 'webclient/components')
-rw-r--r-- | webclient/components/matrix/event-handler-service.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 258de9a31e..8eb8a6b180 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -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() { |