diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index a913da80b7..3035d29fc4 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -69,10 +69,10 @@ helpers.stripTags = function (str) { if (typeof S !== 'undefined') { - return S(str).stripTags().s; + return S(String(str)).stripTags().s; } else { var S = require('string'); - return S(str).stripTags().s; + return S(String(str)).stripTags().s; } }; diff --git a/src/messaging.js b/src/messaging.js index 5bb668ae6e..a37503e3e3 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -210,7 +210,9 @@ Messaging.getTeaser = function (uid, roomId, callback) { }, function (user, next) { teaser.user = user; - next(null, teaser); + plugins.fireHook('filter:messaging.getTeaser', { teaser: teaser }, function (err, data) { + next(err, data.teaser); + }); } ], callback); };