Browse Source
Merge pull request #10731 from nextcloud/techdebt/noid/room-modified-events
Merge pull request #10731 from nextcloud/techdebt/noid/room-modified-events
Document and type PHP eventspull/10754/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
86 changed files with 2433 additions and 87 deletions
-
317docs/events.md
-
23lib/Chat/ChatManager.php
-
1lib/Chat/Command/Executor.php
-
4lib/Chat/MessageParser.php
-
3lib/Config.php
-
1lib/Controller/RoomController.php
-
13lib/Controller/SignalingController.php
-
65lib/Events/AAttendeeRemovedEvent.php
-
58lib/Events/ABeforeJoinedRoomEvent.php
-
42lib/Events/ACallEndedForEveryoneEvent.php
-
51lib/Events/ALobbyModifiedEvent.php
-
53lib/Events/AMessageSentEvent.php
-
71lib/Events/AParticipantModifiedEvent.php
-
76lib/Events/ARoomModifiedEvent.php
-
45lib/Events/ASessionLeftRoomEvent.php
-
60lib/Events/ASystemMessageSentEvent.php
-
3lib/Events/AddEmailEvent.php
-
3lib/Events/AddParticipantsEvent.php
-
3lib/Events/AlreadySharedEvent.php
-
27lib/Events/AttendeeRemovedEvent.php
-
30lib/Events/AttendeesAddedEvent.php
-
5lib/Events/AttendeesEvent.php
-
27lib/Events/BeforeAttendeeRemovedEvent.php
-
27lib/Events/BeforeAttendeesAddedEvent.php
-
27lib/Events/BeforeCallEndedForEveryoneEvent.php
-
27lib/Events/BeforeChatMessageSentEvent.php
-
43lib/Events/BeforeDuplicateShareSentEvent.php
-
41lib/Events/BeforeEmailInvitationSentEvent.php
-
27lib/Events/BeforeGuestJoinedRoomEvent.php
-
27lib/Events/BeforeGuestsCleanedUpEvent.php
-
27lib/Events/BeforeLobbyModifiedEvent.php
-
27lib/Events/BeforeParticipantModifiedEvent.php
-
2lib/Events/BeforeRoomModifiedEvent.php
-
27lib/Events/BeforeSessionLeftRoomEvent.php
-
51lib/Events/BeforeSignalingResponseSentEvent.php
-
27lib/Events/BeforeSignalingRoomPropertiesSentEvent.php
-
27lib/Events/BeforeSystemMessageSentEvent.php
-
51lib/Events/BeforeTurnServersGetEvent.php
-
46lib/Events/BeforeUserJoinedRoomEvent.php
-
57lib/Events/CallEndedForEveryoneEvent.php
-
49lib/Events/CallNotificationSendEvent.php
-
3lib/Events/ChatEvent.php
-
3lib/Events/ChatMessageEvent.php
-
27lib/Events/ChatMessageSentEvent.php
-
3lib/Events/ChatParticipantEvent.php
-
3lib/Events/CommandEvent.php
-
3lib/Events/CreateRoomTokenEvent.php
-
3lib/Events/DuplicatedParticipantEvent.php
-
41lib/Events/EmailInvitationSentEvent.php
-
3lib/Events/EndCallForEveryoneEvent.php
-
3lib/Events/GetTurnServersEvent.php
-
40lib/Events/GuestJoinedRoomEvent.php
-
27lib/Events/GuestsCleanedUpEvent.php
-
3lib/Events/JoinRoomGuestEvent.php
-
3lib/Events/JoinRoomUserEvent.php
-
27lib/Events/LobbyModifiedEvent.php
-
36lib/Events/MessageParseEvent.php
-
3lib/Events/ModifyEveryoneEvent.php
-
3lib/Events/ModifyLobbyEvent.php
-
3lib/Events/ModifyParticipantEvent.php
-
3lib/Events/ModifyRoomEvent.php
-
3lib/Events/ParticipantEvent.php
-
27lib/Events/ParticipantModifiedEvent.php
-
3lib/Events/RemoveParticipantEvent.php
-
3lib/Events/RemoveUserEvent.php
-
27lib/Events/RoomCreatedEvent.php
-
3lib/Events/RoomEvent.php
-
2lib/Events/RoomModifiedEvent.php
-
59lib/Events/RoomPasswordVerifyEvent.php
-
3lib/Events/SendCallNotificationEvent.php
-
27lib/Events/SessionLeftRoomEvent.php
-
3lib/Events/SignalingEvent.php
-
3lib/Events/SignalingRoomPropertiesEvent.php
-
3lib/Events/SilentModifyParticipantEvent.php
-
27lib/Events/SystemMessageSentEvent.php
-
27lib/Events/SystemMessagesMultipleSentEvent.php
-
3lib/Events/UserEvent.php
-
46lib/Events/UserJoinedRoomEvent.php
-
3lib/Events/VerifyRoomPasswordEvent.php
-
19lib/GuestManager.php
-
4lib/Manager.php
-
66lib/Room.php
-
161lib/Service/ParticipantService.php
-
95lib/Service/RoomService.php
-
4lib/Share/RoomShareProvider.php
-
68tests/php/EventDocumentationTest.php
@ -1,209 +1,458 @@ |
|||
# PHP Events |
|||
|
|||
Explanations: |
|||
* `Event class`: is the PHP class of the event object that is passed by the event |
|||
* `Event name`: refers to the PHP constant that contains the full name for the event. You should always use the constants instead of copying the value to avoid problems in the future. Most events have a `Before` and `After` event name. They behave the same and reflect if the event is triggered before or after the action described. |
|||
See the general [Nextcloud Developers - Events](https://docs.nextcloud.com/server/latest/developer_manual/basics/events.html) documentation for information how to listen to the events. |
|||
|
|||
## Conversation related events |
|||
|
|||
### Get conversations list |
|||
### Conversation list fetched |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeRoomsFetchEvent` |
|||
* After event: *Not available* |
|||
* Since: 18.0.0 |
|||
|
|||
### Conversation created |
|||
|
|||
* Before event: *Not available* |
|||
* After event: `OCA\Talk\Events\RoomCreatedEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Conversation deleted |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeRoomDeletedEvent` |
|||
* After event: `OCA\Talk\Events\RoomDeletedEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Conversation modified |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeRoomModifiedEvent` |
|||
* After event: `OCA\Talk\Events\RoomModifiedEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Lobby modified |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeLobbyModifiedEvent` |
|||
* After event: `OCA\Talk\Events\LobbyModifiedEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Call ended for everyone |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeCallEndedForEveryoneEvent` |
|||
* After event: `OCA\Talk\Events\CallEndedForEveryoneEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Conversation password verify |
|||
|
|||
Allows to verify a password and set a redirect URL for the invalid case |
|||
|
|||
* Event: `OCA\Talk\Events\RoomPasswordVerifyEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Deprecated events |
|||
|
|||
These events were not using the typed-event mechanism and are therefore deprecated and will be removed in a future version. |
|||
|
|||
#### Get conversations list |
|||
|
|||
* Event class: `OCA\Talk\Events\UserEvent` |
|||
* Event name: `OCA\Talk\Controller\RoomController::EVENT_BEFORE_ROOMS_GET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomsFetchEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Create conversation |
|||
#### Create conversation |
|||
|
|||
* Event class: `OCA\Talk\Events\RoomEvent` |
|||
* Event name: `OCA\Talk\Room::EVENT_AFTER_ROOM_CREATE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\RoomCreatedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Create token for conversation |
|||
#### Create token for conversation |
|||
|
|||
* Event class: `OCA\Talk\Events\CreateRoomTokenEvent` |
|||
* Event name: `OCA\Talk\Manager::EVENT_TOKEN_GENERATE` |
|||
* Since: 8.0.0 |
|||
* Removed: 11.0.0 |
|||
|
|||
### Set name |
|||
#### Set name |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyRoomEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_NAME_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_NAME_SET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomModifiedEvent` and `OCA\Talk\Events\RoomModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Set password |
|||
#### Set password |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyRoomEvent` |
|||
- No old value is provided |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_PASSWORD_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_PASSWORD_SET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomModifiedEvent` and `OCA\Talk\Events\RoomModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Set type |
|||
#### Set type |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyRoomEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_TYPE_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_TYPE_SET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomModifiedEvent` and `OCA\Talk\Events\RoomModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Set read-only |
|||
#### Set read-only |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyRoomEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_READONLY_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_READONLY_SET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomModifiedEvent` and `OCA\Talk\Events\RoomModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Set listable |
|||
#### Set listable |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyRoomEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_LISTABLE_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_LISTABLE_SET` |
|||
* Since: 11.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomModifiedEvent` and `OCA\Talk\Events\RoomModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Set lobby |
|||
#### Set lobby |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyLobbyEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_LOBBY_STATE_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_LOBBY_STATE_SET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomModifiedEvent` and `OCA\Talk\Events\RoomModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Clean up guests |
|||
#### Clean up guests |
|||
|
|||
* Event class: `OCA\Talk\Events\RoomEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_GUESTS_CLEAN` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_GUESTS_CLEAN` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeGuestsCleanedUpEvent` and `OCA\Talk\Events\GuestsCleanedUpEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Verify password |
|||
#### Verify password |
|||
|
|||
* Event class: `OCA\Talk\Events\VerifyRoomPasswordEvent` |
|||
* Event name: `OCA\Talk\Room::EVENT_PASSWORD_VERIFY` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\RoomPasswordVerifyEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Delete conversation |
|||
#### Delete conversation |
|||
|
|||
* Event class: `OCA\Talk\Events\RoomEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_ROOM_DELETE` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_ROOM_DELETE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeRoomDeletedEvent` and `OCA\Talk\Events\RoomDeletedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
## Participant related events |
|||
|
|||
### Add participants |
|||
### Attendees added |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeAttendeesAddedEvent` |
|||
* Since: 18.0.0 |
|||
* After event: `OCA\Talk\Events\AttendeesAddedEvent` |
|||
* Since: 12.0.0 |
|||
|
|||
### Attendees removed |
|||
|
|||
* Before event: *Not available* |
|||
* After event: `OCA\Talk\Events\AttendeesRemovedEvent` |
|||
* Since: 12.0.0 |
|||
|
|||
### Attendee removed |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeAttendeeRemovedEvent` |
|||
* After event: `OCA\Talk\Events\AttendeeRemovedEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### User joined a conversation |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeUserJoinedRoomEvent` |
|||
* After event: `OCA\Talk\Events\UserJoinedRoomEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Federated user joined a conversation |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeFederatedUserJoinedRoomEvent` |
|||
* After event: `OCA\Talk\Events\FederatedUserJoinedRoomEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Guest joined a conversation |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeGuestJoinedRoomEvent` |
|||
* After event: `OCA\Talk\Events\GuestJoinedRoomEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Email invitation send |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeEmailInvitationSentEvent` |
|||
* After event: `OCA\Talk\Events\EmailInvitationSentEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Session left a conversation |
|||
|
|||
This is the invert action to `User joined a conversation`, `Federated user joined a conversation` and `Guest joined a conversation` |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeSessionLeftRoomEvent` |
|||
* After event: `OCA\Talk\Events\SessionLeftRoomEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Participant modified |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeParticipantModifiedEvent` |
|||
* After event: `OCA\Talk\Events\ParticipantModifiedEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Call notification send |
|||
|
|||
* **internal:** This event is not part of the public API and you should not rely on it |
|||
* Event: `OCA\Talk\Events\CallNotificationSendEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Guests cleaned up |
|||
|
|||
Remove guests without an active session |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeGuestsCleanedUpEvent` |
|||
* After event: `OCA\Talk\Events\GuestsCleanedUpEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Deprecated events |
|||
|
|||
These events were not using the typed-event mechanism and are therefore deprecated and will be removed in a future version. |
|||
|
|||
#### Add participants |
|||
|
|||
* Event class: `OCA\Talk\Events\AddParticipantsEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_USERS_ADD` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_USERS_ADD` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeAttendeesAddedEvent` and `OCA\Talk\Events\AttendeesAddedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Add email |
|||
#### Add email |
|||
|
|||
* Event class: `OCA\Talk\Events\AddEmailEvent` |
|||
* Before event name: `OCA\Talk\GuestManager::EVENT_BEFORE_EMAIL_INVITE` |
|||
* After event name: `OCA\Talk\GuestManager::EVENT_AFTER_EMAIL_INVITE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeEmailInvitationSentEvent` and `OCA\Talk\Events\EmailInvitationSentEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Remove participant by session |
|||
#### Guest changes name |
|||
|
|||
* Event class: `OCA\Talk\Events\RemoveParticipantEvent` |
|||
* Event class: `OCA\Talk\Events\ParticipantEvent` |
|||
* Event name: `OCA\Talk\GuestManager::EVENT_AFTER_NAME_UPDATE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeParticipantModifiedEvent` and `OCA\Talk\Events\ParticipantModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Set participant type for user |
|||
#### Set participant type for user |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyParticipantEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_PARTICIPANT_TYPE_SET` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_PARTICIPANT_TYPE_SET` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeParticipantModifiedEvent` and `OCA\Talk\Events\ParticipantModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Join a conversation as user (Connect) |
|||
#### Join a conversation as user (Connect) |
|||
|
|||
* Event class: `OCA\Talk\Events\JoinRoomUserEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_ROOM_CONNECT` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_ROOM_CONNECT` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeUserJoinedRoomEvent` and `OCA\Talk\Events\UserJoinedRoomEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Join a conversation as guest (Connect) |
|||
#### Join a conversation as guest (Connect) |
|||
|
|||
* Event class: `OCA\Talk\Events\JoinRoomGuestEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_GUEST_CONNECT` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_GUEST_CONNECT` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeGuestJoinedRoomEvent` and `OCA\Talk\Events\GuestJoinedRoomEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Join a call |
|||
#### Join a call |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyParticipantEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_SESSION_JOIN_CALL` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_SESSION_JOIN_CALL` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeParticipantModifiedEvent` and `OCA\Talk\Events\ParticipantModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Leave a call |
|||
#### Leave a call |
|||
|
|||
* Event class: `OCA\Talk\Events\ModifyParticipantEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_SESSION_LEAVE_CALL` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_SESSION_LEAVE_CALL` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeParticipantModifiedEvent` and `OCA\Talk\Events\ParticipantModifiedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Leave a conversation (Disconnect) |
|||
#### Leave a conversation (Disconnect) |
|||
|
|||
* Event class: `OCA\Talk\Events\ParticipantEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_ROOM_DISCONNECT` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_ROOM_DISCONNECT` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeSessionLeftRoomEvent` and `OCA\Talk\Events\SessionLeftRoomEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Remove user |
|||
#### Remove user |
|||
|
|||
* Event class: `OCA\Talk\Events\RemoveUserEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_USER_REMOVE` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_USER_REMOVE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeAttendeeRemovedEvent` and `OCA\Talk\Events\AttendeeRemovedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Remove participant by session |
|||
#### Remove participant by session |
|||
|
|||
* Event class: `OCA\Talk\Events\RemoveParticipantEvent` |
|||
* Before event name: `OCA\Talk\Room::EVENT_BEFORE_PARTICIPANT_REMOVE` |
|||
* After event name: `OCA\Talk\Room::EVENT_AFTER_PARTICIPANT_REMOVE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeAttendeeRemovedEvent` and `OCA\Talk\Events\AttendeeRemovedEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
## Chat related events |
|||
|
|||
### System message |
|||
### Parse chat message |
|||
|
|||
Used to parse mentions, replace parameters in messages with rich objects, transform system messages into readable and translated chat messages etc. |
|||
|
|||
* Event: `OCA\Talk\Events\MessageParseEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Chat message sent |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeChatMessageSentEvent` |
|||
* After event: `OCA\Talk\Events\ChatMessageSentEvent` |
|||
* Since: 18.0.0 |
|||
|
|||
### Duplicate share sent |
|||
|
|||
Sharing the same file a second time is prevented by the API. But this event is dispatched, so that the chat message can be created nevertheless. |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeDuplicateShareSentEvent` |
|||
* After event: *Not available* |
|||
* Since: 18.0.0 |
|||
|
|||
### System message sent |
|||
|
|||
`shouldSkipLastActivityUpdate` indicates whether multiple system messages are being sent. |
|||
In case you only need to be notified after the last system message was posted, |
|||
listen to the `OCA\Talk\Events\SystemMessagesMultipleSentEvent` event instead. |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeSystemMessageSentEvent` |
|||
* After event: `OCA\Talk\Events\SystemMessageSentEvent` |
|||
* Final event: `OCA\Talk\Events\SystemMessagesMultipleSentEvent` - Only sent once as per above explanation |
|||
* Since: 18.0.0 |
|||
|
|||
### Deprecated events |
|||
|
|||
These events were not using the typed-event mechanism and are therefore deprecated and will be removed in a future version. |
|||
|
|||
#### System message |
|||
|
|||
* Event class: `OCA\Talk\Events\ChatEvent` |
|||
* Before event name: `OCA\Talk\Chat\ChatManager::EVENT_BEFORE_SYSTEM_MESSAGE_SEND` |
|||
* After event name: `OCA\Talk\Chat\ChatManager::EVENT_AFTER_SYSTEM_MESSAGE_SEND` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeSystemMessageSentEvent` and `OCA\Talk\Events\SystemMessageSentEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Post chat message |
|||
#### Post chat message |
|||
|
|||
* Event class: `OCA\Talk\Events\ChatEvent` |
|||
* Before event name: `OCA\Talk\Chat\ChatManager::EVENT_BEFORE_MESSAGE_SEND` |
|||
* After event name: `OCA\Talk\Chat\ChatManager::EVENT_AFTER_MESSAGE_SEND` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeChatMessageSentEvent` and `OCA\Talk\Events\ChatMessageSentEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Parse chat message |
|||
#### Parse chat message |
|||
|
|||
* Event class: `OCA\Talk\Events\ChatMessageEvent` |
|||
* Event name: `OCA\Talk\Chat\MessageParser::EVENT_MESSAGE_PARSE` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\MessageParseEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Command execution for apps |
|||
#### Command execution for apps |
|||
|
|||
* Event class: `OCA\Talk\Events\CommandEvent` |
|||
* Event name: `OCA\Talk\Chat\Command\Executor::EVENT_APP_EXECUTE` |
|||
* Since: 8.0.0 |
|||
|
|||
* Deprecated: 17.0.0 - Commands are deprecated, please migrate to bots instead |
|||
|
|||
## Other events |
|||
|
|||
### Signaling backend |
|||
### Turn servers get |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeTurnServersGetEvent` |
|||
* After event: *Not available* |
|||
* Since: 18.0.0 |
|||
|
|||
### Signaling room properties sent |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeSignalingRoomPropertiesSentEvent` |
|||
* After event: *Not available* |
|||
* Since: 18.0.0 |
|||
|
|||
### Signaling response sent |
|||
|
|||
* Before event: `OCA\Talk\Events\BeforeSignalingResponseSentEvent` |
|||
* After event: *Not available* |
|||
* Since: 18.0.0 |
|||
|
|||
### Deprecated events |
|||
|
|||
These events were not using the typed-event mechanism and are therefore deprecated and will be removed in a future version. |
|||
|
|||
#### Signaling backend |
|||
|
|||
* Event class: `OCA\Talk\Events\SignalingEvent` |
|||
* Event name: `OCA\Talk\Controller\SignalingController::EVENT_BACKEND_SIGNALING_ROOMS` |
|||
* Since: 8.0.0 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeSignalingResponseSentEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
### Get conversation properties for signaling |
|||
#### Get conversation properties for signaling |
|||
|
|||
* Event class: `OCA\Talk\Events\SignalingRoomPropertiesEvent` |
|||
* Event name: `OCA\Talk\Room::EVENT_BEFORE_SIGNALING_PROPERTIES` |
|||
* Since: 8.0.5 |
|||
* Deprecated: 18.0.0 - Use `OCA\Talk\Events\BeforeSignalingRoomPropertiesSentEvent` instead |
|||
* Removed: 19.0.0 |
|||
|
|||
## Inbound events to invoke Talk |
|||
|
|||
### Bot install |
|||
|
|||
Dispatch this event in your app to install a bot on this server |
|||
|
|||
* Event: `OCA\Talk\Events\BotInstallEvent` |
|||
* Since: 17.0.0 |
|||
|
|||
### Bot uninstall |
|||
|
|||
Dispatch this event in your app to install a bot on this server |
|||
|
|||
* Event: `OCA\Talk\Events\BotUninstallEvent` |
|||
* Since: 17.0.0 |
|||
@ -0,0 +1,65 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Model\Attendee; |
|||
use OCA\Talk\Model\Session; |
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class AAttendeeRemovedEvent extends RoomEvent { |
|||
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,58 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class ABeforeJoinedRoomEvent extends RoomEvent { |
|||
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,42 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class ACallEndedForEveryoneEvent extends ARoomModifiedEvent { |
|||
public function __construct( |
|||
Room $room, |
|||
?Participant $actor = null, |
|||
) { |
|||
parent::__construct( |
|||
$room, |
|||
self::PROPERTY_IN_CALL, |
|||
Participant::FLAG_DISCONNECTED, |
|||
null, |
|||
$actor |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
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,53 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
use OCP\Comments\IComment; |
|||
|
|||
abstract class AMessageSentEvent extends RoomEvent { |
|||
public function __construct( |
|||
Room $room, |
|||
protected IComment $comment, |
|||
protected ?Participant $participant = null, |
|||
protected bool $silent = false, |
|||
) { |
|||
parent::__construct( |
|||
$room, |
|||
); |
|||
} |
|||
|
|||
public function getComment(): IComment { |
|||
return $this->comment; |
|||
} |
|||
|
|||
public function getParticipant(): ?Participant { |
|||
return $this->participant; |
|||
} |
|||
|
|||
public function isSilentMessage(): bool { |
|||
return $this->silent; |
|||
} |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class AParticipantModifiedEvent extends RoomEvent { |
|||
public const PROPERTY_IN_CALL = 'inCall'; |
|||
public const PROPERTY_NAME = 'name'; |
|||
public const PROPERTY_PERMISSIONS = 'permissions'; |
|||
public const PROPERTY_TYPE = 'type'; |
|||
|
|||
public const DETAIL_IN_CALL_SILENT = 'silent'; |
|||
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 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,76 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class ARoomModifiedEvent extends RoomEvent { |
|||
public const PROPERTY_AVATAR = 'avatar'; |
|||
public const PROPERTY_BREAKOUT_ROOM_MODE = 'breakoutRoomMode'; |
|||
public const PROPERTY_BREAKOUT_ROOM_STATUS = 'breakoutRoomStatus'; |
|||
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_MESSAGE_EXPIRATION = 'messageExpiration'; |
|||
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 string|int $newValue, |
|||
protected string|int|null $oldValue = null, |
|||
protected ?Participant $actor = null, |
|||
) { |
|||
parent::__construct($room); |
|||
} |
|||
|
|||
public function getProperty(): string { |
|||
return $this->property; |
|||
} |
|||
|
|||
public function getNewValue(): string|int { |
|||
return $this->newValue; |
|||
} |
|||
|
|||
public function getOldValue(): string|int|null { |
|||
return $this->oldValue; |
|||
} |
|||
|
|||
public function getActor(): ?Participant { |
|||
return $this->actor; |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
abstract class ASessionLeftRoomEvent extends RoomEvent { |
|||
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,60 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
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, |
|||
protected bool $skipLastActivityUpdate = false, |
|||
) { |
|||
parent::__construct( |
|||
$room, |
|||
$comment, |
|||
$participant, |
|||
$silent |
|||
); |
|||
} |
|||
|
|||
/** |
|||
* 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,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class AttendeeRemovedEvent extends AAttendeeRemovedEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeAttendeeRemovedEvent extends AAttendeeRemovedEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeAttendeesAddedEvent extends AttendeesEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeCallEndedForEveryoneEvent extends ACallEndedForEveryoneEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeChatMessageSentEvent extends AMessageSentEvent { |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2022, Vitor Mattos <vitor@php.rio> |
|||
* |
|||
* @author Vitor Mattos <vitor@php.rio> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
|
|||
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,41 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Model\Attendee; |
|||
use OCA\Talk\Room; |
|||
|
|||
class BeforeEmailInvitationSentEvent extends RoomEvent { |
|||
|
|||
public function __construct( |
|||
Room $room, |
|||
protected Attendee $attendee, |
|||
) { |
|||
parent::__construct($room); |
|||
} |
|||
|
|||
public function getAttendee(): Attendee { |
|||
return $this->attendee; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeGuestJoinedRoomEvent extends ABeforeJoinedRoomEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeGuestsCleanedUpEvent extends RoomEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeLobbyModifiedEvent extends ALobbyModifiedEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeParticipantModifiedEvent extends AParticipantModifiedEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeSessionLeftRoomEvent extends ASessionLeftRoomEvent { |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
class BeforeSignalingResponseSentEvent extends ParticipantEvent { |
|||
protected mixed $session = ''; |
|||
|
|||
public function __construct( |
|||
Room $room, |
|||
Participant $participant, |
|||
protected string $action, |
|||
) { |
|||
parent::__construct($room, $participant); |
|||
} |
|||
|
|||
public function getAction(): string { |
|||
return $this->action; |
|||
} |
|||
|
|||
public function setSession(mixed $session): void { |
|||
$this->session = $session; |
|||
} |
|||
|
|||
public function getSession(): mixed { |
|||
return $this->session; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeSignalingRoomPropertiesSentEvent extends SignalingRoomPropertiesEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class BeforeSystemMessageSentEvent extends ASystemMessageSentEvent { |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2021 Joachim Bauch <mail@joachim-bauch.de> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
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,46 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
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; |
|||
} |
|||
|
|||
public function getPassword(): string { |
|||
return $this->password; |
|||
} |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
class CallEndedForEveryoneEvent extends ACallEndedForEveryoneEvent { |
|||
public function __construct( |
|||
Room $room, |
|||
?Participant $actor = null, |
|||
/** @var string[] */ |
|||
protected array $sessionIds = [], |
|||
/** @var string[] */ |
|||
protected array $userIds = [], |
|||
) { |
|||
parent::__construct( |
|||
$room, |
|||
$actor |
|||
); |
|||
} |
|||
|
|||
/** |
|||
* @return string[] |
|||
*/ |
|||
public function getSessionIds(): array { |
|||
return $this->sessionIds; |
|||
} |
|||
|
|||
/** |
|||
* @return string[] |
|||
*/ |
|||
public function getUserIds(): array { |
|||
return $this->userIds; |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
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 RoomEvent { |
|||
|
|||
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,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class ChatMessageSentEvent extends AMessageSentEvent { |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Model\Attendee; |
|||
use OCA\Talk\Room; |
|||
|
|||
class EmailInvitationSentEvent extends RoomEvent { |
|||
|
|||
public function __construct( |
|||
Room $room, |
|||
protected Attendee $attendee, |
|||
) { |
|||
parent::__construct($room); |
|||
} |
|||
|
|||
public function getAttendee(): Attendee { |
|||
return $this->attendee; |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
|
|||
class GuestJoinedRoomEvent extends RoomEvent { |
|||
public function __construct( |
|||
Room $room, |
|||
protected Participant $participant, |
|||
) { |
|||
parent::__construct($room); |
|||
} |
|||
|
|||
public function getParticipant(): Participant { |
|||
return $this->participant; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class GuestsCleanedUpEvent extends RoomEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class LobbyModifiedEvent extends ALobbyModifiedEvent { |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Model\Message; |
|||
use OCA\Talk\Room; |
|||
|
|||
class MessageParseEvent extends RoomEvent { |
|||
public function __construct( |
|||
Room $room, |
|||
protected Message $message, |
|||
) { |
|||
parent::__construct($room); |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class ParticipantModifiedEvent extends AParticipantModifiedEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class RoomCreatedEvent extends RoomEvent { |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Room; |
|||
|
|||
class RoomPasswordVerifyEvent extends RoomEvent { |
|||
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,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class SessionLeftRoomEvent extends ASessionLeftRoomEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class SystemMessageSentEvent extends ASystemMessageSentEvent { |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
class SystemMessagesMultipleSentEvent extends ASystemMessageSentEvent { |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Events; |
|||
|
|||
use OCA\Talk\Participant; |
|||
use OCA\Talk\Room; |
|||
use OCP\IUser; |
|||
|
|||
class UserJoinedRoomEvent extends RoomEvent { |
|||
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; |
|||
} |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2023, Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @author Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Tests\Unit; |
|||
|
|||
use Test\TestCase; |
|||
|
|||
class EventDocumentationTest extends TestCase { |
|||
public static function dataEventDocumentation(): array { |
|||
$dir = new \DirectoryIterator(__DIR__ . '/../../lib/Events'); |
|||
|
|||
$data = []; |
|||
foreach ($dir as $fileinfo) { |
|||
if (!$fileinfo->isDot()) { |
|||
$data[] = ['OCA\\Talk\\Events\\' . substr($fileinfo->getFilename(), 0, -4)]; |
|||
} |
|||
} |
|||
sort($data); |
|||
return $data; |
|||
} |
|||
|
|||
/** |
|||
* @dataProvider dataEventDocumentation |
|||
* @param string $eventClass |
|||
*/ |
|||
public function testEventDocumentation(string $eventClass): void { |
|||
$reflectionClass = new \ReflectionClass($eventClass); |
|||
if ($reflectionClass->isAbstract()) { |
|||
self::assertTrue(true, 'Abstract event class ' . $eventClass . ' does not have to be documented'); |
|||
return; |
|||
} |
|||
|
|||
$classDocBlock = $reflectionClass->getDocComment(); |
|||
if (is_string($classDocBlock) && str_contains($classDocBlock, '@deprecated')) { |
|||
self::assertTrue(true, 'Deprecated event ' . $eventClass . ' does not have to be documented'); |
|||
return; |
|||
} |
|||
|
|||
$docs = file_get_contents(__DIR__ . '/../../docs/events.md'); |
|||
$eventIsDocumented = str_contains($docs, 'Before event: `' . $eventClass . '`') |
|||
|| str_contains($docs, 'After event: `' . $eventClass . '`') |
|||
|| str_contains($docs, 'Final event: `' . $eventClass . '`') |
|||
|| str_contains($docs, 'Event: `' . $eventClass . '`'); |
|||
self::assertTrue($eventIsDocumented, 'Asserting that event ' . $eventClass . ' is documented'); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue