From: Alexander Ebert Date: Fri, 4 Feb 2022 16:27:24 +0000 (+0100) Subject: Incorrect calculation of the "other participant" avatar X-Git-Tag: 5.5.0_Alpha_1~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8261584b56d65dcf31475024ce91540a349725de;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.conversation.git Incorrect calculation of the "other participant" avatar See #169 --- 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(