UPSTREAM BASELINE: nextcloud/spreed v22.0.12 (без изменений)
Type checking / changes (push) Has been cancelled
Type checking / test (push) Has been cancelled
Type checking / typescript-summary (push) Has been cancelled
Node tests / changes (push) Has been cancelled
Node tests / test (push) Has been cancelled
Node tests / test-summary (push) Has been cancelled
Type checking / changes (push) Has been cancelled
Type checking / test (push) Has been cancelled
Type checking / typescript-summary (push) Has been cancelled
Node tests / changes (push) Has been cancelled
Node tests / test (push) Has been cancelled
Node tests / test-summary (push) Has been cancelled
Источник: https://github.com/nextcloud/spreed/archive/refs/tags/v22.0.12.tar.gz С этого коммита ветка официального Nextcloud Talk отрезана (решение владельца 2026-07-06). Все дальнейшие изменения — только наши; версии релизов: 22.0.12-f7.N.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Attendee;
|
||||
use OCA\Talk\Model\Session;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class AAttendeeRemovedEvent extends ARoomEvent {
|
||||
public const REASON_REMOVED = 'remove';
|
||||
public const REASON_REMOVED_ALL = 'remove_all';
|
||||
public const REASON_LEFT = 'leave';
|
||||
|
||||
/**
|
||||
* @param self::REASON_* $reason
|
||||
* @param Session[] $sessions
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Attendee $attendee,
|
||||
protected string $reason,
|
||||
protected array $sessions,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getAttendee(): Attendee {
|
||||
return $this->attendee;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self::REASON_*
|
||||
*/
|
||||
public function getReason(): string {
|
||||
return $this->reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Session[]
|
||||
*/
|
||||
public function getSessions(): array {
|
||||
return $this->sessions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class ABeforeJoinedRoomEvent extends ARoomEvent {
|
||||
protected bool $cancelJoin = false;
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected string $password,
|
||||
protected bool $passedPasswordProtection,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function setCancelJoin(bool $cancelJoin): void {
|
||||
$this->cancelJoin = $cancelJoin;
|
||||
}
|
||||
|
||||
public function getCancelJoin(): bool {
|
||||
return $this->cancelJoin;
|
||||
}
|
||||
|
||||
public function getPassword(): string {
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassedPasswordProtection(bool $passedPasswordProtection): void {
|
||||
$this->passedPasswordProtection = $passedPasswordProtection;
|
||||
}
|
||||
|
||||
public function getPassedPasswordProtection(): bool {
|
||||
return $this->passedPasswordProtection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
/**
|
||||
* @psalm-method \DateTime getOldValue()
|
||||
*/
|
||||
abstract class ACallEndedEvent extends ARoomModifiedEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
?Participant $actor,
|
||||
\DateTime $oldActiveSince,
|
||||
) {
|
||||
parent::__construct(
|
||||
$room,
|
||||
self::PROPERTY_ACTIVE_SINCE,
|
||||
null,
|
||||
$oldActiveSince,
|
||||
$actor
|
||||
);
|
||||
}
|
||||
|
||||
public function getCallFlag(): int {
|
||||
return Participant::FLAG_DISCONNECTED;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
abstract class ACallEndedForEveryoneEvent extends ACallEndedEvent {
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class ACallStartedEvent extends ARoomModifiedEvent {
|
||||
/**
|
||||
* @param array<AParticipantModifiedEvent::DETAIL_*, bool|list<string>> $details
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
?\DateTime $newValue,
|
||||
protected int $callFlag,
|
||||
protected array $details,
|
||||
?Participant $actor,
|
||||
) {
|
||||
parent::__construct(
|
||||
$room,
|
||||
self::PROPERTY_ACTIVE_SINCE,
|
||||
$newValue,
|
||||
null,
|
||||
$actor,
|
||||
);
|
||||
}
|
||||
|
||||
public function getCallFlag(): int {
|
||||
return $this->callFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AParticipantModifiedEvent::DETAIL_* $detail
|
||||
*/
|
||||
public function getDetail(string $detail): ?bool {
|
||||
if (!isset($this->details[$detail])) {
|
||||
return null;
|
||||
}
|
||||
return (bool)$this->details[$detail];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AParticipantModifiedEvent::DETAIL_* $detail
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getDetailList(string $detail): array {
|
||||
if (!isset($this->details[$detail]) || !is_array($this->details[$detail])) {
|
||||
return [];
|
||||
}
|
||||
return $this->details[$detail];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class ALobbyModifiedEvent extends ARoomModifiedEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
string|int $newValue,
|
||||
string|int|null $oldValue,
|
||||
protected ?\DateTime $lobbyTimer,
|
||||
protected bool $timerReached,
|
||||
) {
|
||||
parent::__construct(
|
||||
$room,
|
||||
self::PROPERTY_LOBBY,
|
||||
$newValue,
|
||||
$oldValue,
|
||||
);
|
||||
}
|
||||
|
||||
public function getLobbyTimer(): ?\DateTime {
|
||||
return $this->lobbyTimer;
|
||||
}
|
||||
|
||||
public function isTimerReached(): bool {
|
||||
return $this->timerReached;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
use OCP\Comments\IComment;
|
||||
|
||||
abstract class AMessageSentEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected IComment $comment,
|
||||
protected ?Participant $participant = null,
|
||||
protected bool $silent = false,
|
||||
protected ?IComment $parent = null,
|
||||
) {
|
||||
parent::__construct(
|
||||
$room,
|
||||
);
|
||||
}
|
||||
|
||||
public function getComment(): IComment {
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function getParticipant(): ?Participant {
|
||||
return $this->participant;
|
||||
}
|
||||
|
||||
public function isSilentMessage(): bool {
|
||||
return $this->silent;
|
||||
}
|
||||
|
||||
public function getParent(): ?IComment {
|
||||
return $this->parent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class AParticipantModifiedEvent extends ARoomEvent {
|
||||
public const PROPERTY_IN_CALL = 'inCall';
|
||||
public const PROPERTY_NAME = 'name';
|
||||
public const PROPERTY_PERMISSIONS = 'permissions';
|
||||
public const PROPERTY_RESEND_CALL = 'resend_call_notification';
|
||||
public const PROPERTY_TYPE = 'type';
|
||||
|
||||
public const DETAIL_IN_CALL_SILENT = 'silent';
|
||||
public const DETAIL_IN_CALL_SILENT_FOR = 'silentFor';
|
||||
public const DETAIL_IN_CALL_END_FOR_EVERYONE = 'endForEveryone';
|
||||
|
||||
/**
|
||||
* @param self::PROPERTY_* $property
|
||||
* @param array<self::DETAIL_*, bool> $details
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Participant $participant,
|
||||
protected string $property,
|
||||
protected string|int $newValue,
|
||||
protected string|int|null $oldValue = null,
|
||||
protected array $details = [],
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getParticipant(): Participant {
|
||||
return $this->participant;
|
||||
}
|
||||
|
||||
public function getProperty(): string {
|
||||
return $this->property;
|
||||
}
|
||||
|
||||
public function getNewValue(): string|int {
|
||||
return $this->newValue;
|
||||
}
|
||||
|
||||
public function getOldValue(): string|int|null {
|
||||
return $this->oldValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param self::DETAIL_* $detail
|
||||
*/
|
||||
public function getDetail(string $detail): ?bool {
|
||||
return $this->details[$detail] ?? null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
use OCP\Comments\IComment;
|
||||
|
||||
abstract class AReactionEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected IComment $message,
|
||||
protected string $actorType,
|
||||
protected string $actorId,
|
||||
protected string $actorDisplayName,
|
||||
protected string $reaction,
|
||||
protected ?IComment $reactionMessage = null,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getMessage(): IComment {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function getReactionMessage(): ?IComment {
|
||||
return $this->reactionMessage;
|
||||
}
|
||||
|
||||
|
||||
public function getActorType(): string {
|
||||
return $this->actorType;
|
||||
}
|
||||
|
||||
public function getActorId(): string {
|
||||
return $this->actorId;
|
||||
}
|
||||
|
||||
public function getActorDisplayName(): string {
|
||||
return $this->actorDisplayName;
|
||||
}
|
||||
|
||||
public function getReaction(): string {
|
||||
return $this->reaction;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
abstract class ARoomEvent extends Event {
|
||||
|
||||
|
||||
public function __construct(
|
||||
protected Room $room,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getRoom(): Room {
|
||||
return $this->room;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class ARoomModifiedEvent extends ARoomEvent {
|
||||
public const PROPERTY_ACTIVE_SINCE = 'activeSince';
|
||||
public const PROPERTY_AVATAR = 'avatar';
|
||||
public const PROPERTY_BREAKOUT_ROOM_MODE = 'breakoutRoomMode';
|
||||
public const PROPERTY_BREAKOUT_ROOM_STATUS = 'breakoutRoomStatus';
|
||||
/** @deprecated */
|
||||
public const PROPERTY_CALL_PERMISSIONS = 'callPermissions';
|
||||
public const PROPERTY_CALL_RECORDING = 'callRecording';
|
||||
public const PROPERTY_DEFAULT_PERMISSIONS = 'defaultPermissions';
|
||||
public const PROPERTY_DESCRIPTION = 'description';
|
||||
public const PROPERTY_IN_CALL = 'inCall';
|
||||
public const PROPERTY_LISTABLE = 'listable';
|
||||
public const PROPERTY_LOBBY = 'lobby';
|
||||
public const PROPERTY_LIVE_TRANSCRIPTION_LANGUAGE_ID = 'liveTranscriptionLanguageId';
|
||||
public const PROPERTY_MESSAGE_EXPIRATION = 'messageExpiration';
|
||||
public const PROPERTY_MENTION_PERMISSIONS = 'mentionPermissions';
|
||||
public const PROPERTY_NAME = 'name';
|
||||
public const PROPERTY_PASSWORD = 'password';
|
||||
public const PROPERTY_READ_ONLY = 'readOnly';
|
||||
public const PROPERTY_RECORDING_CONSENT = 'recordingConsent';
|
||||
public const PROPERTY_SIP_ENABLED = 'sipEnabled';
|
||||
public const PROPERTY_TYPE = 'type';
|
||||
|
||||
/**
|
||||
* @param self::PROPERTY_* $property
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected string $property,
|
||||
protected \DateTime|string|int|null $newValue,
|
||||
protected \DateTime|string|int|null $oldValue = null,
|
||||
protected ?Participant $actor = null,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getProperty(): string {
|
||||
return $this->property;
|
||||
}
|
||||
|
||||
public function getNewValue(): \DateTime|string|int|null {
|
||||
return $this->newValue;
|
||||
}
|
||||
|
||||
public function getOldValue(): \DateTime|string|int|null {
|
||||
return $this->oldValue;
|
||||
}
|
||||
|
||||
public function getActor(): ?Participant {
|
||||
return $this->actor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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;
|
||||
|
||||
abstract class ARoomSyncedEvent extends ARoomEvent {
|
||||
public const PROPERTY_LAST_ACTIVITY = 'lastActivity';
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class ASessionLeftRoomEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Participant $participant,
|
||||
protected bool $rejoining,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getParticipant(): Participant {
|
||||
return $this->participant;
|
||||
}
|
||||
|
||||
public function isRejoining(): bool {
|
||||
return $this->rejoining;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
use OCP\Comments\IComment;
|
||||
|
||||
abstract class ASystemMessageSentEvent extends AMessageSentEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
IComment $comment,
|
||||
?Participant $participant = null,
|
||||
bool $silent = false,
|
||||
?IComment $parent = null,
|
||||
protected bool $skipLastActivityUpdate = false,
|
||||
) {
|
||||
parent::__construct(
|
||||
$room,
|
||||
$comment,
|
||||
$participant,
|
||||
$silent,
|
||||
$parent,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* If multiple messages will be posted (e.g. when adding multiple users to a room)
|
||||
* we can skip the last message and last activity update until the last entry
|
||||
* was created and then update with those values.
|
||||
* This will replace O(n) with 1 database update.
|
||||
*
|
||||
* A {@see SystemMessagesMultipleSentEvent} will be triggered
|
||||
* as a final event when all system messages have been created.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldSkipLastActivityUpdate(): bool {
|
||||
return $this->skipLastActivityUpdate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class AttendeeRemovedEvent extends AAttendeeRemovedEvent {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Attendee;
|
||||
use OCA\Talk\Room;
|
||||
use OCP\Comments\IComment;
|
||||
|
||||
class AttendeesAddedEvent extends AttendeesEvent {
|
||||
protected ?IComment $lastMessage = null;
|
||||
|
||||
/**
|
||||
* @param Attendee[] $attendees
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
array $attendees,
|
||||
protected bool $skipLastMessageUpdate = false,
|
||||
) {
|
||||
parent::__construct($room, $attendees);
|
||||
}
|
||||
|
||||
public function shouldSkipLastMessageUpdate(): bool {
|
||||
return $this->skipLastMessageUpdate;
|
||||
}
|
||||
|
||||
public function setLastMessage(IComment $lastMessage): void {
|
||||
$this->lastMessage = $lastMessage;
|
||||
}
|
||||
|
||||
public function getLastMessage(): ?IComment {
|
||||
return $this->lastMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Attendee;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
abstract class AttendeesEvent extends ARoomEvent {
|
||||
/**
|
||||
* @param Attendee[] $attendees
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected array $attendees,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attendee[]
|
||||
*/
|
||||
public function getAttendees(): array {
|
||||
return $this->attendees;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class AttendeesRemovedEvent extends AttendeesEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeAttendeeRemovedEvent extends AAttendeeRemovedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeAttendeesAddedEvent extends AttendeesEvent {
|
||||
}
|
||||
@@ -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 BeforeCallEndedEvent extends ACallEndedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeCallEndedForEveryoneEvent extends ACallEndedForEveryoneEvent {
|
||||
}
|
||||
@@ -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 BeforeCallStartedEvent extends ACallStartedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeChatMessageSentEvent extends AMessageSentEvent {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class BeforeDuplicateShareSentEvent extends Event {
|
||||
public function __construct(
|
||||
private IShare $share,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function getShare(): IShare {
|
||||
return $this->share;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Attendee;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class BeforeEmailInvitationSentEvent extends ARoomEvent {
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Attendee $attendee,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getAttendee(): Attendee {
|
||||
return $this->attendee;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeFederatedUserJoinedRoomEvent extends FederatedUserJoinedRoomEvent {
|
||||
protected bool $cancelJoin = false;
|
||||
|
||||
public function isJoinCanceled(): bool {
|
||||
return $this->cancelJoin;
|
||||
}
|
||||
public function cancelJoin(): void {
|
||||
$this->cancelJoin = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeGuestJoinedRoomEvent extends ABeforeJoinedRoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeGuestsCleanedUpEvent extends ARoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeLobbyModifiedEvent extends ALobbyModifiedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeParticipantModifiedEvent extends AParticipantModifiedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeReactionAddedEvent extends AReactionEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeReactionRemovedEvent extends AReactionEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeRoomDeletedEvent extends ARoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeRoomModifiedEvent extends ARoomModifiedEvent {
|
||||
}
|
||||
@@ -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 BeforeRoomSyncedEvent extends ARoomSyncedEvent {
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class BeforeRoomsFetchEvent extends Event {
|
||||
public function __construct(
|
||||
protected string $userId,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getUserId(): string {
|
||||
return $this->userId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeSessionLeftRoomEvent extends ASessionLeftRoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class BeforeSignalingResponseSentEvent extends ARoomEvent {
|
||||
protected array $session = [];
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Participant $participant,
|
||||
protected string $action,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getParticipant(): Participant {
|
||||
return $this->participant;
|
||||
}
|
||||
|
||||
public function getAction(): string {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
public function setSession(array $session): void {
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
public function getSession(): array {
|
||||
return $this->session;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class BeforeSignalingRoomPropertiesSentEvent extends ARoomEvent {
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected ?string $userId,
|
||||
protected array $properties,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getUserId(): ?string {
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
public function getProperties(): array {
|
||||
return $this->properties;
|
||||
}
|
||||
|
||||
public function setProperty(string $property, $data): void {
|
||||
$this->properties[$property] = $data;
|
||||
}
|
||||
|
||||
public function unsetProperty(string $property): void {
|
||||
unset($this->properties[$property]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class BeforeSystemMessageSentEvent extends ASystemMessageSentEvent {
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class BeforeTurnServersGetEvent extends Event {
|
||||
/**
|
||||
* @param list<array{schemes?: string, server: string, protocols: string, username?: string, password?: string, secret?: string}> $servers
|
||||
*/
|
||||
public function __construct(
|
||||
protected array $servers,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{schemes?: string, server: string, protocols: string, username?: string, password?: string, secret?: string}>
|
||||
*/
|
||||
public function getServers(): array {
|
||||
return $this->servers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array{schemes?: string, server: string, protocols: string, username?: string, password?: string, secret?: string}> $servers
|
||||
*/
|
||||
public function setServers(array $servers): void {
|
||||
$this->servers = $servers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
use OCP\IUser;
|
||||
|
||||
class BeforeUserJoinedRoomEvent extends ABeforeJoinedRoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected IUser $user,
|
||||
string $password,
|
||||
bool $passedPasswordProtection,
|
||||
) {
|
||||
parent::__construct($room, $password, $passedPasswordProtection);
|
||||
}
|
||||
|
||||
public function getUser(): IUser {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getPassword(): string {
|
||||
return $this->password;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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\Model\BotServer;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class BotDisabledEvent extends ARoomEvent {
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected BotServer $botServer,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getBotServer(): BotServer {
|
||||
return $this->botServer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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\Model\BotServer;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class BotEnabledEvent extends ARoomEvent {
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected BotServer $botServer,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getBotServer(): BotServer {
|
||||
return $this->botServer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Bot;
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class BotInstallEvent extends Event {
|
||||
public function __construct(
|
||||
protected string $name,
|
||||
protected string $secret,
|
||||
protected string $url,
|
||||
protected string $description = '',
|
||||
protected ?int $features = null,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getName(): string {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getSecret(): string {
|
||||
return $this->secret;
|
||||
}
|
||||
|
||||
public function getUrl(): string {
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
public function getDescription(): string {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getFeatures(): int {
|
||||
if ($this->features !== null) {
|
||||
return $this->features;
|
||||
}
|
||||
if (str_starts_with($this->url, Bot::URL_APP_PREFIX)) {
|
||||
return Bot::FEATURE_EVENT;
|
||||
}
|
||||
return Bot::FEATURE_WEBHOOK | Bot::FEATURE_RESPONSE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* @psalm-type ChatMessageParentData = array{
|
||||
* type: 'Note',
|
||||
* actor: array{
|
||||
* type: 'Person',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* },
|
||||
* object: array{
|
||||
* type: 'Note',
|
||||
* id: numeric-string,
|
||||
* name: string,
|
||||
* content: non-empty-string,
|
||||
* mediaType: 'text/markdown'|'text/plain',
|
||||
* },
|
||||
* }
|
||||
* @psalm-type ChatMessageData = array{
|
||||
* type: 'Activity'|'Create',
|
||||
* actor: array{
|
||||
* type: 'Person',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* talkParticipantType: numeric-string,
|
||||
* },
|
||||
* object: array{
|
||||
* type: 'Note',
|
||||
* id: numeric-string,
|
||||
* name: string,
|
||||
* content: non-empty-string,
|
||||
* mediaType: 'text/markdown'|'text/plain',
|
||||
* inReplyTo?: ChatMessageParentData,
|
||||
* threadId?: int,
|
||||
* },
|
||||
* target: array{
|
||||
* type: 'Collection',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* },
|
||||
* }
|
||||
* @psalm-type ReactionMessageData = array{
|
||||
* type: 'Like',
|
||||
* actor: array{
|
||||
* type: 'Person',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* talkParticipantType?: numeric-string,
|
||||
* },
|
||||
* object: array{
|
||||
* type: 'Note',
|
||||
* id: numeric-string,
|
||||
* name: string,
|
||||
* content: non-empty-string,
|
||||
* mediaType: 'text/markdown'|'text/plain',
|
||||
* inReplyTo?: ChatMessageParentData,
|
||||
* },
|
||||
* target: array{
|
||||
* type: 'Collection',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* },
|
||||
* content: string,
|
||||
* }
|
||||
* @psalm-type UndoReactionMessageData = array{
|
||||
* type: 'Undo',
|
||||
* actor: array{
|
||||
* type: 'Person',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* talkParticipantType?: numeric-string,
|
||||
* },
|
||||
* object: ReactionMessageData,
|
||||
* target: array{
|
||||
* type: 'Collection',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* },
|
||||
* }
|
||||
* @psalm-type BotManagementData = array{
|
||||
* type: 'Join'|'Leave',
|
||||
* actor: array{
|
||||
* type: 'Application',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* },
|
||||
* object: array{
|
||||
* type: 'Collection',
|
||||
* id: non-empty-string,
|
||||
* name: non-empty-string,
|
||||
* },
|
||||
* }
|
||||
* @psalm-type InvocationData = ChatMessageData|ReactionMessageData|UndoReactionMessageData|BotManagementData
|
||||
*/
|
||||
class BotInvokeEvent extends Event {
|
||||
/** @var list<string> */
|
||||
protected array $reactions = [];
|
||||
/** @var list<array{message: string, referenceId: string, reply: bool|int, thread: bool, threadTitle: ?string, silent: bool}> */
|
||||
protected array $answers = [];
|
||||
|
||||
/**
|
||||
* @param InvocationData $message
|
||||
*/
|
||||
public function __construct(
|
||||
protected string $botUrl,
|
||||
protected array $message,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getBotUrl(): string {
|
||||
return $this->botUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return InvocationData
|
||||
*/
|
||||
public function getMessage(): array {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function addReaction(string $emoji): void {
|
||||
$this->reactions[] = $emoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getReactions(): array {
|
||||
return $this->reactions;
|
||||
}
|
||||
|
||||
public function addAnswer(string $message, bool|int $reply = false, bool $silent = false, string $referenceId = '', bool $thread = false, ?string $threadTitle = null): void {
|
||||
$this->answers[] = [
|
||||
'message' => $message,
|
||||
'referenceId' => $referenceId,
|
||||
'reply' => $reply,
|
||||
'thread' => $thread,
|
||||
'threadTitle' => $threadTitle,
|
||||
'silent' => $silent,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{message: string, referenceId: string, reply: bool|int, thread: bool, threadTitle: ?string, silent: bool}>
|
||||
*/
|
||||
public function getAnswers(): array {
|
||||
return $this->answers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class BotUninstallEvent extends Event {
|
||||
public function __construct(
|
||||
protected string $secret,
|
||||
protected string $url,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getSecret(): string {
|
||||
return $this->secret;
|
||||
}
|
||||
|
||||
public function getUrl(): string {
|
||||
return $this->url;
|
||||
}
|
||||
}
|
||||
@@ -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 CallEndedEvent extends ACallEndedEvent {
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class CallEndedForEveryoneEvent extends ACallEndedForEveryoneEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
?Participant $actor,
|
||||
\DateTime $oldActiveSince,
|
||||
/** @var string[] */
|
||||
protected array $sessionIds = [],
|
||||
/** @var string[] */
|
||||
protected array $userIds = [],
|
||||
) {
|
||||
parent::__construct(
|
||||
$room,
|
||||
$actor,
|
||||
$oldActiveSince,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSessionIds(): array {
|
||||
return $this->sessionIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getUserIds(): array {
|
||||
return $this->userIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
/**
|
||||
* @internal This event is not part of the public API and you should not rely on it.
|
||||
*/
|
||||
class CallNotificationSendEvent extends ARoomEvent {
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected ?Participant $actor,
|
||||
protected Participant $target,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getActor(): ?Participant {
|
||||
return $this->actor;
|
||||
}
|
||||
|
||||
public function getTarget(): Participant {
|
||||
return $this->target;
|
||||
}
|
||||
}
|
||||
@@ -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 CallStartedEvent extends ACallStartedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class ChatMessageSentEvent extends AMessageSentEvent {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Attendee;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class EmailInvitationSentEvent extends ARoomEvent {
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Attendee $attendee,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getAttendee(): Attendee {
|
||||
return $this->attendee;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class FederatedUserJoinedRoomEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected string $cloudId,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getCloudId(): string {
|
||||
return $this->cloudId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class GuestJoinedRoomEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Participant $participant,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getParticipant(): Participant {
|
||||
return $this->participant;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class GuestsCleanedUpEvent extends ARoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class LobbyModifiedEvent extends ALobbyModifiedEvent {
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Model\Message;
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class MessageParseEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected Message $message,
|
||||
protected bool $allowInaccurate,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getMessage(): Message {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
public function allowInaccurate(): bool {
|
||||
return $this->allowInaccurate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class OverwritePublicSharePropertiesEvent extends Event {
|
||||
public function __construct(
|
||||
protected IShare $share,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getShare(): IShare {
|
||||
return $this->share;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class ParticipantModifiedEvent extends AParticipantModifiedEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class ReactionAddedEvent extends AReactionEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class ReactionRemovedEvent extends AReactionEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class RoomCreatedEvent extends ARoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class RoomDeletedEvent extends ARoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class RoomExtendedEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $oldRoom,
|
||||
protected Room $newRoom,
|
||||
) {
|
||||
parent::__construct($oldRoom);
|
||||
}
|
||||
|
||||
public function getNewRoom(): Room {
|
||||
return $this->newRoom;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class RoomModifiedEvent extends ARoomModifiedEvent {
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Room;
|
||||
|
||||
class RoomPasswordVerifyEvent extends ARoomEvent {
|
||||
protected ?bool $isPasswordValid = null;
|
||||
protected string $redirectUrl = '';
|
||||
|
||||
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected string $password,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getPassword(): string {
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setIsPasswordValid(bool $isPasswordValid): void {
|
||||
$this->isPasswordValid = $isPasswordValid;
|
||||
}
|
||||
|
||||
public function isPasswordValid(): ?bool {
|
||||
return $this->isPasswordValid;
|
||||
}
|
||||
|
||||
public function setRedirectUrl(string $redirectUrl): void {
|
||||
$this->redirectUrl = $redirectUrl;
|
||||
}
|
||||
|
||||
public function getRedirectUrl(): string {
|
||||
return $this->redirectUrl;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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;
|
||||
|
||||
class RoomSyncedEvent extends ARoomSyncedEvent {
|
||||
/**
|
||||
* @param array<array-key, ARoomModifiedEvent::PROPERTY_*|ARoomSyncedEvent::PROPERTY_*> $properties
|
||||
*/
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected array $properties,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array-key, ARoomModifiedEvent::PROPERTY_*|ARoomSyncedEvent::PROPERTY_*>
|
||||
*/
|
||||
public function getProperties(): array {
|
||||
return $this->properties;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class SessionLeftRoomEvent extends ASessionLeftRoomEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class SystemMessageSentEvent extends ASystemMessageSentEvent {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
class SystemMessagesMultipleSentEvent extends ASystemMessageSentEvent {
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Talk\Events;
|
||||
|
||||
use OCA\Talk\Participant;
|
||||
use OCA\Talk\Room;
|
||||
use OCP\IUser;
|
||||
|
||||
class UserJoinedRoomEvent extends ARoomEvent {
|
||||
public function __construct(
|
||||
Room $room,
|
||||
protected IUser $user,
|
||||
protected Participant $participant,
|
||||
) {
|
||||
parent::__construct($room);
|
||||
}
|
||||
|
||||
public function getUser(): IUser {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getParticipant(): Participant {
|
||||
return $this->participant;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user