FEATURE: add grace period for chat edits (#23800)

This change allows users to edit their chat messages based on the criteria added to Site Settings.

If the grace period conditions are met then there will be no (edited) text applied to the message.

The following site settings are added to chat:

chat editing grace period (seconds since message created)
chat editing grace period max diff for low trust levels (number of characters changed)
chat editing grace period max diff for high trust levels (number of characters changed)
This commit is contained in:
David Battersby
2023-10-23 16:40:30 +08:00
committed by GitHub
parent 6121869900
commit f1e22dfebd
20 changed files with 1056 additions and 850 deletions

View File

@ -129,9 +129,9 @@ RSpec.describe "Outgoing chat webhooks" do
end
it "triggers a webhook when a chat message is edited" do
put "/chat/#{chat_channel.id}/edit/#{chat_message.id}.json",
put "/chat/api/channels/#{chat_channel.id}/messages/#{chat_message.id}.json",
params: {
new_message: new_message_content,
message: new_message_content,
}
expect_response_to_be_successful
@ -195,9 +195,9 @@ RSpec.describe "Outgoing chat webhooks" do
end
it "triggers a webhook when a chat message is edited" do
put "/chat/#{direct_message_channel.id}/edit/#{chat_message.id}.json",
put "/chat/api/channels/#{direct_message_channel.id}/messages/#{chat_message.id}.json",
params: {
new_message: new_message_content,
message: new_message_content,
}
expect_response_to_be_successful