-
Notifications
You must be signed in to change notification settings - Fork 13k
feat(apps): add IPostSystemMessageSent event #35177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9c22b82
feat: add IPostSystemMessageSent event
Gustrb 8c7b549
chore: remove console.log
Gustrb 7426888
Merge branch 'develop' into feat/post-sent-system-messages-event
Gustrb ba5ce41
chore: apply suggestions
Gustrb c842839
fix: wrong test
Gustrb 8c32430
chore: empty line
Gustrb 1a252d6
Create happy-nails-fry.md
Gustrb 0ead680
Merge branch 'develop' into feat/post-sent-system-messages-event
Gustrb 94c5156
Merge branch 'develop' into feat/post-sent-system-messages-event
Gustrb 423c7f8
Update .changeset/happy-nails-fry.md
Gustrb 26d5711
chore: trigger system messages event in sendMessage
Gustrb bd3d4a3
Merge branch 'develop' into feat/post-sent-system-messages-event
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@rocket.chat/meteor": minor | ||
| "@rocket.chat/apps-engine": minor | ||
| "@rocket.chat/apps": minor | ||
| --- | ||
|
|
||
| Adds a new IPostSystemMessageSent event, that is triggered whenever a new System Message is sent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/apps-engine/src/definition/messages/IPostSystemMessageSent.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import type { IHttp, IModify, IPersistence, IRead } from '../accessors'; | ||
| import type { IMessage } from './IMessage'; | ||
|
|
||
| /** | ||
| * Handler for when a System message is sent. | ||
| * System messages are messages that are not sent by a user, but by the system itself. | ||
| */ | ||
| export interface IPostSystemMessageSent { | ||
| /** | ||
| * Method called *after* the system message is sent to the other clients. | ||
| */ | ||
| executePostSystemMessageSent(message: IMessage, read: IRead, http: IHttp, persistence: IPersistence, modify: IModify): Promise<void>; | ||
| } |
143 changes: 143 additions & 0 deletions
143
packages/apps-engine/src/definition/messages/MessageType.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| /** | ||
| * Usually, normal messages won't have a type, but system messages will, end those are the types that are available. | ||
| */ | ||
| export type MessageType = | ||
| /** Sent when a voip call has started */ | ||
| | 'voip-call-started' | ||
| /** Sent when a voip call has been declined */ | ||
| | 'voip-call-declined' | ||
| /** Sent when a voip call is put on hold */ | ||
| | 'voip-call-on-hold' | ||
| /** Sent when a voip call is unhold */ | ||
| | 'voip-call-unhold' | ||
| /** Sent when a voip call is paused */ | ||
| | 'voip-call-ended' | ||
| /** Sent when a voip call is over, contains the duration of the call */ | ||
| | 'voip-call-duration' | ||
| /** Sent when a voip call is ended */ | ||
| | 'voip-call-wrapup' | ||
| /** Sent when a voip call is ended unexpectedly */ | ||
| | 'voip-call-ended-unexpectedly' | ||
| /** Sent when a user is removed from main room of a team */ | ||
| | 'removed-user-from-team' | ||
| /** Sent when a user is added to a team */ | ||
| | 'added-user-to-team' | ||
| /** Sent when a user leaves a team */ | ||
| | 'ult' | ||
| /** Sent when a user converts a room into a team */ | ||
| | 'user-converted-to-team' | ||
| /** Sent when a user converts a room into a channel */ | ||
| | 'user-converted-to-channel' | ||
| /** Sent when a user removes a room from a team */ | ||
| | 'user-removed-room-from-team' | ||
| /** Sent when a user deletes a room inside a team */ | ||
| | 'user-deleted-room-from-team' | ||
| /** Sent when a user adds a room to a team */ | ||
| | 'user-added-room-to-team' | ||
| /** Sent when a user joins a team */ | ||
| | 'ujt' | ||
| /** Sent when the navigation history of a livechat conversation is requested */ | ||
| | 'livechat_navigation_history' | ||
| /** Sent when the conversation is transferred */ | ||
| | 'livechat_transfer_history' | ||
| /** Sent when the transcript is requested */ | ||
| | 'livechat_transcript_history' | ||
| /** Sent when a video call is requested */ | ||
| | 'livechat_video_call' | ||
| /** Sent when there is a history fallback */ | ||
| | 'livechat_transfer_history_fallback' | ||
| /** Sent when a livechat conversation is closed */ | ||
| | 'livechat-close' | ||
| /** Sent when a livechat conversation is started */ | ||
| | 'livechat_webrtc_video_call' | ||
| /** Sent when a livechat conversation is started */ | ||
| | 'livechat-started' | ||
| /** Sent when the priority of omnichannel is changed */ | ||
| | 'omnichannel_priority_change_history' | ||
| /** Sent when the sla of omnichannel is changed */ | ||
| | 'omnichannel_sla_change_history' | ||
| /** Sent when a chat is placed on hold */ | ||
| | 'omnichannel_placed_chat_on_hold' | ||
| /** Sent when a chat is resumed */ | ||
| | 'omnichannel_on_hold_chat_resumed' | ||
| | 'otr' | ||
| | 'otr-ack' | ||
| | 'user_joined_otr' | ||
| | 'user_requested_otr_key_refresh' | ||
| | 'user_key_refreshed_successfully' | ||
| /** Sent when the message came through e2e */ | ||
| | 'e2e' | ||
| /** Sent when a user has joined a room */ | ||
| | 'uj' | ||
| /** Sent when a user has left a room */ | ||
| | 'ul' | ||
| /** Sent when a user was removed */ | ||
| | 'ru' | ||
| /** Sent when a user was added */ | ||
| | 'au' | ||
| /** Sent when system messages were muted */ | ||
| | 'mute_unmute' | ||
| /** Sent when a room name was changed */ | ||
| | 'r' | ||
| /** Sent when a user joined a conversation */ | ||
| | 'ut' | ||
| /** Welcome message */ | ||
| | 'wm' | ||
| /** Sent when a message was removed */ | ||
| | 'rm' | ||
| /** Sent when the role of a subscription has added */ | ||
| | 'subscription-role-added' | ||
| /** Sent when the role of a subscription has removed */ | ||
| | 'subscription-role-removed' | ||
| /** Sent when the room was archived */ | ||
| | 'room-archived' | ||
| /** Sent when the room was unarchived */ | ||
| | 'room-unarchived' | ||
| /** Sent when the privacy of the room has changed */ | ||
| | 'room_changed_privacy' | ||
| /** Sent when the description of a room was changed */ | ||
| | 'room_changed_description' | ||
| /** Sent when the announcement of a room was changed */ | ||
| | 'room_changed_announcement' | ||
| /** Sent when the avatar of a room was changed */ | ||
| | 'room_changed_avatar' | ||
| /** Sent when the topic of a room was changed */ | ||
| | 'room_changed_topic' | ||
| /** Sent when e2e was enabled in a room */ | ||
| | 'room_e2e_enabled' | ||
| /** Sent when e2e was disabled in a room */ | ||
| | 'room_e2e_disabled' | ||
| /** Sent when a user was muted */ | ||
| | 'user-muted' | ||
| /** Sent when a user was unmuted */ | ||
| | 'user-unmuted' | ||
| /** Sent when a room is not readonly anymore */ | ||
| | 'room-removed-read-only' | ||
| /** Sent when a room is set to readonly */ | ||
| | 'room-set-read-only' | ||
| /** Sent when a room is set to allow reacting */ | ||
| | 'room-allowed-reacting' | ||
| /** Sent when a room is set to disallow reacting */ | ||
| | 'room-disallowed-reacting' | ||
| /** Sent on several instances when, such as when a livechat room is started */ | ||
| | 'command' | ||
| /** Sent when a message is the start of a videoconf */ | ||
| | 'videoconf' | ||
| /** Sent when a message was pinned */ | ||
| | 'message_pinned' | ||
| /** Sent when an e2e message was pinned */ | ||
| | 'message_pinned_e2e' | ||
| /** Sent when the room has a new moderator */ | ||
| | 'new-moderator' | ||
| /** Sent when a moderator was removed */ | ||
| | 'moderator-removed' | ||
| /** Sent when a room has a new owner */ | ||
| | 'new-owner' | ||
| /** Sent when an owner was removed */ | ||
| | 'owner-removed' | ||
| /** Sent when a room has a new leader */ | ||
| | 'new-leader' | ||
| /** Sent when a leader was removed */ | ||
| | 'leader-removed' | ||
| /** Sent when a user was added to a room */ | ||
| | 'discussion-created'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.