FIX: Duplicate error for chat messages for upload-only messages (#31539)

This commit fixes an issue where if you tried to post
2 chat messages in quick succession which only contained
uploads (both `message` fields would be `""`), then we
would show the "You posted an identical message too recently."
error.

We should not do this for upload-only messages, they
are not identical messages.
This commit is contained in:
Martin Brennan
2025-02-27 17:17:36 +10:00
committed by GitHub
parent e92e05b22e
commit bf287b4560
3 changed files with 40 additions and 8 deletions

View File

@ -168,6 +168,10 @@ module Chat
Emoji.gsub_emoji_to_unicode(message).truncate(400)
end
def only_uploads?
self.message.blank? && self.uploads.present?
end
def to_markdown
upload_markdown =
self