Skip to content
Snippets Groups Projects
Unverified Commit 7ee9ca11 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento Committed by GitHub
Browse files

regression(E2EEncryption): Fix edition of encrypted messages not working (#32700)

parent 22719e0c
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP
import { settings } from '../../../settings/server';
import { updateMessage } from '../functions/updateMessage';
const allowedEditedFields = ['tshow', 'alias', 'attachments', 'avatar', 'emoji', 'msg', 'customFields'];
const allowedEditedFields = ['tshow', 'alias', 'attachments', 'avatar', 'emoji', 'msg', 'customFields', 'content'];
export async function executeUpdateMessage(uid: IUser['_id'], message: AtLeast<IMessage, '_id' | 'rid' | 'msg'>, previewUrls?: string[]) {
const originalMessage = await Messages.findOneById(message._id);
......
......@@ -17,7 +17,7 @@ export const processMessageEditing = async (
return false;
}
if (!message.msg && !message.attachments?.length) {
if (!message.msg && !message.attachments?.length && !message.content) {
return false;
}
......
......@@ -22,16 +22,16 @@ const process = async (chat: ChatAPI, message: IMessage, previewUrls?: string[],
return;
}
if (await processMessageEditing(chat, message, previewUrls)) {
return;
}
if (isSlashCommandAllowed && (await processSlashCommand(chat, message))) {
return;
}
message = (await onClientBeforeSendMessage(message)) as IMessage;
if (await processMessageEditing(chat, message, previewUrls)) {
return;
}
await sdk.call('sendMessage', message, previewUrls);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment