diff --git a/app/assets/javascripts/discourse/dialects/quote_dialect.js b/app/assets/javascripts/discourse/dialects/quote_dialect.js index 3c50598cfcb..28f8de131cb 100644 --- a/app/assets/javascripts/discourse/dialects/quote_dialect.js +++ b/app/assets/javascripts/discourse/dialects/quote_dialect.js @@ -26,7 +26,9 @@ Discourse.BBCode.register('quote', {noWrap: true, singlePara: true}, function(co if (options.lookupAvatarByPostNumber) { // client-side, we can retrieve the avatar from the post var postNumber = parseInt(params['data-post'], 10); - avatarImg = options.lookupAvatarByPostNumber(postNumber); + var topicId = parseInt(params['data-topic'], 10); + + avatarImg = options.lookupAvatarByPostNumber(postNumber, topicId); } else if (options.lookupAvatar) { // server-side, we need to lookup the avatar from the username avatarImg = options.lookupAvatar(username); diff --git a/app/assets/javascripts/discourse/views/composer.js.es6 b/app/assets/javascripts/discourse/views/composer.js.es6 index 8a4050bc033..6c3047ba8f8 100644 --- a/app/assets/javascripts/discourse/views/composer.js.es6 +++ b/app/assets/javascripts/discourse/views/composer.js.es6 @@ -260,9 +260,9 @@ const ComposerView = Discourse.View.extend(Ember.Evented, { this.editor = editor = Discourse.Markdown.createEditor({ containerElement: this.element, - lookupAvatarByPostNumber(postNumber) { + lookupAvatarByPostNumber(postNumber, topicId) { const posts = self.get('controller.controllers.topic.model.postStream.posts'); - if (posts) { + if (posts && topicId === self.get('controller.controllers.topic.model.id')) { const quotedPost = posts.findProperty("post_number", postNumber); if (quotedPost) { const username = quotedPost.get('username'),