Skip to content

Commit

Permalink
regression(E2EEncryption): Fix edition of encrypted messages not work…
Browse files Browse the repository at this point in the history
…ing (#32700)
  • Loading branch information
rodrigok committed Jul 1, 2024
1 parent 22719e0 commit 7ee9ca1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/app/lib/server/methods/updateMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions apps/meteor/client/lib/chats/flows/sendMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 7ee9ca1

Please sign in to comment.