Browse Source
feat(bots): Allow bots to get invoked for reactions
feat(bots): Allow bots to get invoked for reactions
Signed-off-by: Joas Schilling <coding@schilljs.com>pull/14335/head
No known key found for this signature in database
GPG Key ID: F72FA5B49FFA96B0
15 changed files with 253 additions and 10 deletions
-
12docs/events.md
-
4lib/AppInfo/Application.php
-
29lib/Chat/ReactionManager.php
-
2lib/Controller/BotController.php
-
2lib/Controller/ReactionController.php
-
45lib/Events/AReactionEvent.php
-
12lib/Events/BeforeReactionAddedEvent.php
-
12lib/Events/BeforeReactionRemovedEvent.php
-
40lib/Events/BotInvokeEvent.php
-
12lib/Events/ReactionAddedEvent.php
-
12lib/Events/ReactionRemovedEvent.php
-
10lib/Listener/BotListener.php
-
3lib/Model/Bot.php
-
66lib/Service/BotService.php
-
2lib/Service/SampleConversationsService.php
@ -0,0 +1,45 @@ |
|||
<?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, |
|||
) { |
|||
parent::__construct($room); |
|||
} |
|||
|
|||
public function getMessage(): IComment { |
|||
return $this->message; |
|||
} |
|||
|
|||
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,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: 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 { |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue