feat: Security
This commit is contained in:
@@ -36,7 +36,8 @@ export async function handleUpdateMessage(command: UpdateMessageCommand, dataSou
|
||||
const nullableFields = [
|
||||
'channelId',
|
||||
'editedAt',
|
||||
'replyToId'
|
||||
'replyToId',
|
||||
'headHash'
|
||||
] as const;
|
||||
|
||||
for (const field of nullableFields) {
|
||||
@@ -44,8 +45,13 @@ export async function handleUpdateMessage(command: UpdateMessageCommand, dataSou
|
||||
entity[field] = updates[field] ?? null;
|
||||
}
|
||||
|
||||
if (updates.isDeleted !== undefined)
|
||||
if (updates.revision !== undefined) {
|
||||
existing.revision = updates.revision;
|
||||
}
|
||||
|
||||
if (updates.isDeleted !== undefined) {
|
||||
existing.isDeleted = updates.isDeleted ? 1 : 0;
|
||||
}
|
||||
|
||||
if (updates.linkMetadata !== undefined)
|
||||
existing.linkMetadata = updates.linkMetadata ? JSON.stringify(updates.linkMetadata) : null;
|
||||
|
||||
Reference in New Issue
Block a user