summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-12-12 14:54:21 +0100
committerJoas Schilling <coding@schilljs.com>2023-12-12 14:54:21 +0100
commit6168a4cbdad28b474067f26229fe0bf241ae3098 (patch)
treea245e58508920b12a36acb7221224905f0450fca
parentd9ac070071be995c8be82184eb16f756fd360128 (diff)
Temp
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/Activity/Listener.php7
-rw-r--r--lib/Controller/CallController.php11
-rw-r--r--lib/Listener/RestrictStartingCalls.php6
-rw-r--r--lib/Notification/Listener.php9
-rw-r--r--lib/Service/ParticipantService.php19
5 files changed, 45 insertions, 7 deletions
diff --git a/lib/Activity/Listener.php b/lib/Activity/Listener.php
index 2147767fe..bf49c60b5 100644
--- a/lib/Activity/Listener.php
+++ b/lib/Activity/Listener.php
@@ -74,6 +74,9 @@ class Listener implements IEventListener {
}
protected function setActive(ParticipantModifiedEvent $event): void {
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #8: ' . microtime(true));
+ }
if ($event->getProperty() !== AParticipantModifiedEvent::PROPERTY_IN_CALL) {
return;
}
@@ -82,7 +85,6 @@ class Listener implements IEventListener {
|| $event->getNewValue() === Participant::FLAG_DISCONNECTED) {
return;
}
-
$participant = $event->getParticipant();
$this->roomService->setActiveSince(
$event->getRoom(),
@@ -90,6 +92,9 @@ class Listener implements IEventListener {
$participant->getSession() ? $participant->getSession()->getInCall() : Participant::FLAG_DISCONNECTED,
$participant->getAttendee()->getActorType() !== Attendee::ACTOR_USERS
);
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #9: ' . microtime(true));
+ }
}
protected function handleParticipantModified(ParticipantModifiedEvent $event): void {
diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php
index d669e90ae..4b6cfa021 100644
--- a/lib/Controller/CallController.php
+++ b/lib/Controller/CallController.php
@@ -141,6 +141,9 @@ class CallController extends AEnvironmentAwareController {
#[RequireParticipant]
#[RequireReadWriteConversation]
public function joinCall(?int $flags = null, ?int $forcePermissions = null, bool $silent = false, bool $recordingConsent = false): DataResponse {
+ if ($this->room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #0: ' . microtime(true));
+ }
if (!$recordingConsent && $this->talkConfig->recordingConsentRequired() !== RecordingService::CONSENT_REQUIRED_NO) {
if ($this->talkConfig->recordingConsentRequired() === RecordingService::CONSENT_REQUIRED_YES) {
return new DataResponse(['error' => 'consent'], Http::STATUS_BAD_REQUEST);
@@ -169,9 +172,13 @@ class CallController extends AEnvironmentAwareController {
if ($forcePermissions !== null && $this->participant->hasModeratorPermissions()) {
$this->roomService->setPermissions($this->room, 'call', Attendee::PERMISSIONS_MODIFY_SET, $forcePermissions, true);
}
-
+ if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #1: ' . microtime(true));
+ }
$joined = $this->participantService->changeInCall($this->room, $this->participant, $flags, false, $silent);
-
+ if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #2: ' . microtime(true));
+ }
if (!$joined) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
diff --git a/lib/Listener/RestrictStartingCalls.php b/lib/Listener/RestrictStartingCalls.php
index 80d13d896..6a3b6eaea 100644
--- a/lib/Listener/RestrictStartingCalls.php
+++ b/lib/Listener/RestrictStartingCalls.php
@@ -53,6 +53,9 @@ class RestrictStartingCalls implements IEventListener {
if (!$event instanceof BeforeParticipantModifiedEvent) {
return;
}
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #10: ' . microtime(true));
+ }
if ($event->getProperty() !== AParticipantModifiedEvent::PROPERTY_IN_CALL) {
return;
@@ -74,5 +77,8 @@ class RestrictStartingCalls implements IEventListener {
&& !$this->participantService->hasActiveSessionsInCall($room)) {
throw new ForbiddenException('Can not start a call');
}
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #11: ' . microtime(true));
+ }
}
}
diff --git a/lib/Notification/Listener.php b/lib/Notification/Listener.php
index b078879e9..8c584eb87 100644
--- a/lib/Notification/Listener.php
+++ b/lib/Notification/Listener.php
@@ -227,10 +227,19 @@ class Listener implements IEventListener {
return;
}
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #12: ' . microtime(true));
+ }
$this->markCallNotificationsRead($event->getRoom());
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #13: ' . microtime(true));
+ }
if ($this->shouldSendCallNotification) {
$this->sendCallNotifications($event->getRoom());
}
+ if ($event->getRoom()->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #14: ' . microtime(true));
+ }
}
/**
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php
index 0b652a3f2..23d5bee52 100644
--- a/lib/Service/ParticipantService.php
+++ b/lib/Service/ParticipantService.php
@@ -1155,6 +1155,9 @@ class ParticipantService {
}
public function changeInCall(Room $room, Participant $participant, int $flags, bool $endCallForEveryone = false, bool $silent = false): bool {
+ if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #3: ' . microtime(true));
+ }
if ($room->getType() === Room::TYPE_CHANGELOG
|| $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER
|| $room->getType() === Room::TYPE_NOTE_TO_SELF) {
@@ -1177,6 +1180,9 @@ class ParticipantService {
$oldFlags = $session->getInCall();
$details = [];
+ if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #4: ' . microtime(true));
+ }
if ($flags !== Participant::FLAG_DISCONNECTED) {
if ($silent) {
$legacyEvent = new SilentModifyParticipantEvent($room, $participant, 'inCall', $flags, $session->getInCall());
@@ -1194,10 +1200,11 @@ class ParticipantService {
}
$this->dispatcher->dispatch(Room::EVENT_BEFORE_SESSION_LEAVE_CALL, $legacyEvent);
}
-
$event = new BeforeParticipantModifiedEvent($room, $participant, AParticipantModifiedEvent::PROPERTY_IN_CALL, $flags, $oldFlags, $details);
$this->dispatcher->dispatchTyped($event);
-
+ if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #5: ' . microtime(true));
+ }
$session->setInCall($flags);
if (!$endCallForEveryone) {
$this->sessionMapper->update($session);
@@ -1211,14 +1218,18 @@ class ParticipantService {
$attendee->setCallId('');
$this->attendeeMapper->update($attendee);
}
-
+ if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #6: ' . microtime(true));
+ }
if ($flags !== Participant::FLAG_DISCONNECTED) {
$this->dispatcher->dispatch(Room::EVENT_AFTER_SESSION_JOIN_CALL, $legacyEvent);
} else {
$this->dispatcher->dispatch(Room::EVENT_AFTER_SESSION_LEAVE_CALL, $legacyEvent);
}
$event = new ParticipantModifiedEvent($room, $participant, AParticipantModifiedEvent::PROPERTY_IN_CALL, $flags, $oldFlags, $details);
- $this->dispatcher->dispatchTyped($event);
+ $this->dispatcher->dispatchTyped($event); if ($room->getToken() === 'c9bui2ju') {
+ \OC::$server->getLogger()->warning('Debugging step #7: ' . microtime(true));
+ }
return true;
}