Missing other participants in the drop-down menu
authorAlexander Ebert <ebert@woltlab.com>
Sun, 1 May 2022 12:00:15 +0000 (14:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 1 May 2022 12:00:15 +0000 (14:00 +0200)
Fixes #174

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

index abe40c8b5a068d34b3668fd750a3b4cfcaeac249..d600dc64191f43c482f60b0234ec57a4ed552b38 100644 (file)
@@ -11,6 +11,7 @@ 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;
@@ -916,8 +917,15 @@ class ConversationAction extends AbstractDatabaseObjectAction implements
                     $usernames = [$conversation->getOtherParticipantProfile()->username];
                 }
             } else {
-                $image = $conversation->getUserProfile()->getAvatar()->getImageTag(48);
-                $usernames = [$conversation->getUserProfile()->username];
+                if ($conversation->participants > 1) {
+                    $image = '<span class="icon icon48 fa-users"></span>';
+                    $usernames = \array_filter($conversation->getParticipantSummary(), function (User $user) {
+                        return $user->userID !== WCF::getUser()->userID;
+                    });
+                } else {
+                    $image = $conversation->getUserProfile()->getAvatar()->getImageTag(48);
+                    $usernames = [$conversation->getUserProfile()->username];
+                }
             }
 
             $link = LinkHandler::getInstance()->getControllerLink(