FIX: remove complicated 'chat_duplicate_message_sensitivity' site setting (#30516)

And change the "formula" to check for duplicate messages to

- no duplicate check in 1:1 DMs
- only duplicate check in group DMs / channels, for posts made by the
same user, in the past 10 seconds

Internal ref - t/144262
This commit is contained in:
Régis Hanol
2025-01-13 12:32:51 +01:00
committed by GitHub
parent d7aa13328d
commit 1f483f48a0
11 changed files with 124 additions and 165 deletions

View File

@ -43,7 +43,7 @@ module ChatSystemHelpers
chat_channel_id: channel.id,
in_reply_to_id: in_reply_to,
thread_id: thread_id,
message: Faker::Alphanumeric.alpha(number: SiteSetting.chat_minimum_message_length),
message: fake_chat_message,
},
)
@ -68,6 +68,10 @@ module ChatSpecHelpers
)
end
def fake_chat_message
Faker::Alphanumeric.alpha(number: [15, SiteSetting.chat_minimum_message_length].max)
end
def update_message!(message, text: nil, user: Discourse.system_user, upload_ids: nil)
Chat::UpdateMessage.call(
guardian: user.guardian,