From 8261584b56d65dcf31475024ce91540a349725de Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 4 Feb 2022 17:27:24 +0100 Subject: [PATCH] Incorrect calculation of the "other participant" avatar See #169 --- .../data/conversation/ConversationAction.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/files/lib/data/conversation/ConversationAction.class.php b/files/lib/data/conversation/ConversationAction.class.php index 09b18dc..3aa3c34 100644 --- a/files/lib/data/conversation/ConversationAction.class.php +++ b/files/lib/data/conversation/ConversationAction.class.php @@ -11,7 +11,6 @@ use wcf\data\IClipboardAction; use wcf\data\IPopoverAction; use wcf\data\IVisitableObjectAction; use wcf\data\user\group\UserGroup; -use wcf\data\user\User; use wcf\page\ConversationPage; use wcf\system\clipboard\ClipboardHandler; use wcf\system\conversation\ConversationHandler; @@ -908,10 +907,14 @@ class ConversationAction extends AbstractDatabaseObjectAction implements } return \array_map(static function (ViewableConversation $conversation) { - if ($conversation->participants > 1) { - $image = ''; + if ($conversation->userID === WCF::getUser()->userID) { + if ($conversation->participants > 1) { + $image = ''; + } else { + $image = $conversation->getOtherParticipantProfile()->getAvatar()->getImageTag(48); + } } else { - $image = $conversation->getOtherParticipantProfile()->getAvatar()->getImageTag(48); + $image = $conversation->getUserProfile()->getAvatar()->getImageTag(48); } $link = LinkHandler::getInstance()->getControllerLink( -- 2.20.1