Browse Source
feat: Propagate "in call" status of rooms to federated servers
feat: Propagate "in call" status of rooms to federated servers
"In call" status is set from two different properties, "active since" and "call flag". Call flags can be modified independently, but "active since" is always linked to setting call flags, so the event needs to include both properties. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>pull/12668/head
10 changed files with 189 additions and 9 deletions
-
6docs/events.md
-
2lib/AppInfo/Application.php
-
36lib/Events/AActiveSinceModifiedEvent.php
-
9lib/Events/ARoomModifiedEvent.php
-
12lib/Events/ActiveSinceModifiedEvent.php
-
12lib/Events/BeforeActiveSinceModifiedEvent.php
-
43lib/Federation/BackendNotifier.php
-
13lib/Federation/CloudFederationProviderTalk.php
-
24lib/Federation/Proxy/TalkV1/Notifier/RoomModifiedListener.php
-
41lib/Service/RoomService.php
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class AActiveSinceModifiedEvent extends ARoomModifiedEvent { |
|||
public function __construct( |
|||
Room $room, |
|||
?\DateTime $newValue, |
|||
?\DateTime $oldValue, |
|||
protected int $callFlag, |
|||
protected int $oldCallFlag, |
|||
) { |
|||
parent::__construct( |
|||
$room, |
|||
self::PROPERTY_ACTIVE_SINCE, |
|||
$newValue, |
|||
$oldValue, |
|||
); |
|||
} |
|||
|
|||
public function getCallFlag(): int { |
|||
return $this->callFlag; |
|||
} |
|||
|
|||
public function getOldCallFlag(): int { |
|||
return $this->oldCallFlag; |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class ActiveSinceModifiedEvent extends AActiveSinceModifiedEvent { |
|||
} |
@ -0,0 +1,12 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeActiveSinceModifiedEvent extends AActiveSinceModifiedEvent { |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue