From 12ebd59ed89169dafc528248f7fed102e5031db5 Mon Sep 17 00:00:00 2001 From: Leon Klingele Date: Mon, 5 Sep 2016 11:57:32 +0200 Subject: [PATCH] Do not encode the body of a desktop notification --- static/js/controllers/chatroomcontroller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/controllers/chatroomcontroller.js b/static/js/controllers/chatroomcontroller.js index d6611ef8..c2686e20 100644 --- a/static/js/controllers/chatroomcontroller.js +++ b/static/js/controllers/chatroomcontroller.js @@ -20,7 +20,7 @@ */ "use strict"; -define(['jquery', 'underscore', 'moment', 'text!partials/fileinfo.html', 'text!partials/contactrequest.html', 'text!partials/geolocation.html', 'text!partials/picturehover.html'], function($, _, moment, templateFileInfo, templateContactRequest, templateGeolocation, templatePictureHover) { +define(['angular', 'jquery', 'underscore', 'moment', 'text!partials/fileinfo.html', 'text!partials/contactrequest.html', 'text!partials/geolocation.html', 'text!partials/picturehover.html'], function(angular, $, _, moment, templateFileInfo, templateContactRequest, templateGeolocation, templatePictureHover) { // ChatroomController return ["$scope", "$element", "$window", "safeMessage", "safeDisplayName", "$compile", "$filter", "translation", "mediaStream", function($scope, $element, $window, safeMessage, safeDisplayName, $compile, $filter, translation, mediaStream) { @@ -220,6 +220,9 @@ define(['jquery', 'underscore', 'moment', 'text!partials/fileinfo.html', 'text!p var element; var scroll = this.canScroll(); lastMessageContainer = null; + if (angular.isString(s)) { + s = safeMessage(s); + } if (!extra_css) { extra_css = ""; @@ -547,7 +550,7 @@ define(['jquery', 'underscore', 'moment', 'text!partials/fileinfo.html', 'text!p if (!noop) { // Default handling is to use full message with security in place. if (message === null && nodes === null && data.Message && typeof data.Message == "string") { - message = safeMessage(data.Message); + message = data.Message; } // Show the beast. element = $scope.showmessage(from, timestamp, message, nodes);