diff --git a/app/assets/javascripts/discourse/components/notification-item.js.es6 b/app/assets/javascripts/discourse/components/notification-item.js.es6
index a13cd0d5d6c..d4692458cba 100644
--- a/app/assets/javascripts/discourse/components/notification-item.js.es6
+++ b/app/assets/javascripts/discourse/components/notification-item.js.es6
@@ -53,7 +53,7 @@ export default Ember.Component.extend({
const notification = this.get('notification');
const description = this.get('description');
const username = notification.get('data.display_username');
- const text = I18n.t(this.get('scope'), {description, username});
+ const text = Discourse.Emoji.unescape(I18n.t(this.get('scope'), {description, username}));
const url = this.get('url');
if (url) {
diff --git a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb
index 67e1a4048b3..29ecdd469af 100644
--- a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb
+++ b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb
@@ -29,6 +29,18 @@ for (var name in aliases) {
});
}
+Discourse.Emoji.unescape = function(string) {
+ if (Discourse.SiteSettings.enable_emoji && string.indexOf(":") >= 0) {
+ string = string.replace(/:[^\s:]+:?/g, function(m) {
+ const emoji = Discourse.Emoji.translations[m] ? Discourse.Emoji.translations[m] : m.slice(1, m.length - 1),
+ url = Discourse.Emoji.urlFor(emoji);
+ return url ? "" : m;
+ });
+ }
+
+ return string;
+}
+
Discourse.Emoji.urlFor = urlFor = function(code) {
var url, set = Discourse.SiteSettings.emoji_set;
diff --git a/app/assets/javascripts/discourse/models/topic.js.es6 b/app/assets/javascripts/discourse/models/topic.js.es6
index 798053e3c25..486129f4f9f 100644
--- a/app/assets/javascripts/discourse/models/topic.js.es6
+++ b/app/assets/javascripts/discourse/models/topic.js.es6
@@ -6,17 +6,7 @@ const Topic = RestModel.extend({
errorLoading: false,
fancyTitle: function() {
- let title = this.get("fancy_title");
-
- if (Discourse.SiteSettings.enable_emoji && title.indexOf(":") >= 0) {
- title = title.replace(/:[^\s:]+:?/g, function(m) {
- const emoji = Discourse.Emoji.translations[m] ? Discourse.Emoji.translations[m] : m.slice(1, m.length - 1),
- url = Discourse.Emoji.urlFor(emoji);
- return url ? "
" : m;
- });
- }
-
- return title;
+ return Discourse.Emoji.unescape(this.get('fancy_title'));
}.property("fancy_title"),
// returns createdAt if there's no bumped date
diff --git a/app/assets/javascripts/discourse/models/user-stream.js.es6 b/app/assets/javascripts/discourse/models/user-stream.js.es6
index 635b349dbfd..ac3883ba388 100644
--- a/app/assets/javascripts/discourse/models/user-stream.js.es6
+++ b/app/assets/javascripts/discourse/models/user-stream.js.es6
@@ -68,6 +68,7 @@ export default RestModel.extend({
if (result && result.user_actions) {
const copy = Em.A();
result.user_actions.forEach(function(action) {
+ action.title = Discourse.Emoji.unescape(action.title);
copy.pushObject(Discourse.UserAction.create(action));
});
diff --git a/app/assets/javascripts/discourse/templates/user/stream.hbs b/app/assets/javascripts/discourse/templates/user/stream.hbs
index 0637feec4b3..96e96c83768 100644
--- a/app/assets/javascripts/discourse/templates/user/stream.hbs
+++ b/app/assets/javascripts/discourse/templates/user/stream.hbs
@@ -5,7 +5,7 @@
{{format-date item.created_at}}
{{topic-status topic=item disableActions=true}}
- {{unbound item.title}}
+ {{{unbound item.title}}}