Incorrect calculation of the "other participant" avatar
authorAlexander Ebert <ebert@woltlab.com>
Fri, 4 Feb 2022 16:27:24 +0000 (17:27 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 4 Feb 2022 16:27:24 +0000 (17:27 +0100)
See #169

files/lib/data/conversation/ConversationAction.class.php

index 09b18dcc4a75886fd78a720c4002cb20a4ac65de..3aa3c34fd5226c20c3cbf4e31a50eb44e9c6130b 100644 (file)
@@ -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 = '<span class="icon icon48 fa-users"></span>';
+            if ($conversation->userID === WCF::getUser()->userID) {
+                if ($conversation->participants > 1) {
+                    $image = '<span class="icon icon48 fa-users"></span>';
+                } else {
+                    $image = $conversation->getOtherParticipantProfile()->getAvatar()->getImageTag(48);
+                }
             } else {
-                $image = $conversation->getOtherParticipantProfile()->getAvatar()->getImageTag(48);
+                $image = $conversation->getUserProfile()->getAvatar()->getImageTag(48);
             }
 
             $link = LinkHandler::getInstance()->getControllerLink(