Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-02-26 02:21:47 +0300
committerJoas Schilling <coding@schilljs.com>2022-02-28 14:07:40 +0300
commitb57196179f8c093eafbd6a8a680c182c95c90bee (patch)
treea27df7c4a7195addc09b8262b41473c309560121
parent61ca0b374097fac9cf505b53fc5c1208a42eb618 (diff)
Only calculate the room name once instead of loading all participantstechdebt/noid/improve-activity-generation
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/Activity/Listener.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Activity/Listener.php b/lib/Activity/Listener.php
index 232225b68..57410417f 100644
--- a/lib/Activity/Listener.php
+++ b/lib/Activity/Listener.php
@@ -232,6 +232,11 @@ class Listener {
return;
}
+ // We know the new participant is in the room,
+ // so skip loading them just to make sure they can read it.
+ // Must be overwritten later on for one-to-one chats.
+ $roomName = $room->getDisplayName($actorId);
+
foreach ($participants as $participant) {
if ($participant['actorType'] !== Attendee::ACTOR_USERS) {
// No user => no activity
@@ -244,7 +249,10 @@ class Listener {
}
try {
- $roomName = $room->getDisplayName($participant['actorId']);
+ if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
+ // Overwrite the room name with the other participant
+ $roomName = $room->getDisplayName($participant['actorId']);
+ }
$event
->setObject('room', $room->getId(), $roomName)
->setSubject('invitation', [