mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:00:49 +08:00
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:
@ -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,
|
||||
|
Reference in New Issue
Block a user