Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/apps/server/bridges/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export class AppMessageBridge extends MessageBridge {
updateMessage(msg, editor);
}

protected async delete(messageId: string, appId: string): Promise<void> {
this.orch.debugLog(`The App ${appId} is deleting a message.`);
Messages.removeById(messageId);
Copy link
Contributor

@murtaza98 murtaza98 Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't delete the database entry directly from here. There are a couple of checks that need to be performed, also some hooks that need to be called, before we actually delete a message from DB. You can take a look at this file to understand more about this: app/lib/server/functions/deleteMessage.ts.

}

protected async notifyUser(user: IUser, message: IMessage, appId: string): Promise<void> {
this.orch.debugLog(`The App ${appId} is notifying a user.`);

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@
"Apps_Permissions_server-setting_write": "Modify settings in this server",
"Apps_Permissions_room_read": "Access room information",
"Apps_Permissions_room_write": "Create and modify rooms",
"Apps_Permissions_message_delete": "Delete messages",
"Apps_Permissions_message_read": "Access messages",
"Apps_Permissions_message_write": "Send and modify messages",
"Apps_Permissions_livechat-status_read": "Access Livechat status information",
Expand Down