mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:42:57 +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) {
|
||||
// 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);
|
||||
|
|
|
@ -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'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user