discourse/plugins/chat/lib/chat
Joffrey JAFFEUX 54b2a85b27
FIX: ensures all_mentioned_user_ids is not used as identifier (#21452)
When making the list of users to notify we set `all_mentioned_user_ids` key on the `to_notify` Hash.

This hash will be passed around until the actual moment where we send the notifications:

```ruby
identifier_text =
  case identifier_type
  when :here_mentions
    "@here"
  when :global_mentions
    "@all"
  when :direct_mentions
    ""
  else
    "@#{identifier_type}"
  end
```

As not found `all_mentioned_user_ids` would end up being sent as `@all_mentioned_user_ids` which is obviously incorrect.

This commit is a direct fix to the issue and will remove the key as soon as we have used it sooner up in the chain.

This bug was reproducible when doing this sequence of events:

- create a message with a direct mention: `@bob hi`
- edit this message into a global mention `@all hi`
2023-05-09 13:00:19 +02:00
..
bookmark_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
category_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
channel_archive_service.rb
channel_fetcher.rb FIX: Do not count thread messages for channel unreads (#21126) 2023-04-19 08:53:51 +10:00
channel_hashtag_data_source.rb
channel_membership_manager.rb FEATURE: Auto-remove users without permission from channel (#20344) 2023-03-22 10:19:59 +10:00
direct_message_channel_creator.rb
duplicate_message_validator.rb
engine.rb
guardian_extensions.rb
mailer.rb
message_bookmarkable.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
message_creator.rb FIX: no event when threading is disabled (#21439) 2023-05-09 10:11:29 +02:00
message_mover.rb FIX: Ensure order when moving chat messages to another channel (#21447) 2023-05-09 10:37:12 +08:00
message_processor.rb
message_rate_limiter.rb
message_reactor.rb
message_updater.rb DEV: Create and update chat message mentions earlier (#21388) 2023-05-05 15:47:07 +04:00
notifier.rb FIX: ensures all_mentioned_user_ids is not used as identifier (#21452) 2023-05-09 13:00:19 +02:00
parsed_mentions.rb DEV: Create and update chat message mentions earlier (#21388) 2023-05-05 15:47:07 +04:00
plugin_instance_extension.rb
post_notification_handler.rb
review_queue.rb
reviewable_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
secure_uploads_compatibility.rb
seeder.rb
slack_compatibility.rb
statistics.rb
steps_inspector.rb DEV: Move channel creation for category into service (#21167) 2023-04-24 09:15:16 +10:00
transcript_service.rb
user_email_extension.rb
user_extension.rb
user_notifications_extension.rb
user_option_extension.rb