mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 15:08:56 +08:00
FIX: stop showing incorrect avatars in quote
This commit is contained in:
parent
4486879fd2
commit
aef575aad0
|
@ -26,7 +26,9 @@ Discourse.BBCode.register('quote', {noWrap: true, singlePara: true}, function(co
|
||||||
if (options.lookupAvatarByPostNumber) {
|
if (options.lookupAvatarByPostNumber) {
|
||||||
// client-side, we can retrieve the avatar from the post
|
// client-side, we can retrieve the avatar from the post
|
||||||
var postNumber = parseInt(params['data-post'], 10);
|
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) {
|
} else if (options.lookupAvatar) {
|
||||||
// server-side, we need to lookup the avatar from the username
|
// server-side, we need to lookup the avatar from the username
|
||||||
avatarImg = options.lookupAvatar(username);
|
avatarImg = options.lookupAvatar(username);
|
||||||
|
|
|
@ -260,9 +260,9 @@ const ComposerView = Discourse.View.extend(Ember.Evented, {
|
||||||
|
|
||||||
this.editor = editor = Discourse.Markdown.createEditor({
|
this.editor = editor = Discourse.Markdown.createEditor({
|
||||||
containerElement: this.element,
|
containerElement: this.element,
|
||||||
lookupAvatarByPostNumber(postNumber) {
|
lookupAvatarByPostNumber(postNumber, topicId) {
|
||||||
const posts = self.get('controller.controllers.topic.model.postStream.posts');
|
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);
|
const quotedPost = posts.findProperty("post_number", postNumber);
|
||||||
if (quotedPost) {
|
if (quotedPost) {
|
||||||
const username = quotedPost.get('username'),
|
const username = quotedPost.get('username'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user