discourse/app/services
Martin Brennan 44f15d4281
FIX: Do not email group user with user_private_message notification (#11754)
There was an issue that occurred with this order of operations:

* An IMAP topic was created by emailing a group
* A second user was invited to the topic (not the OP and not the group)
* A user with access to the group replies to the topic
* The second user receives a user_private_message notification email because of their involvement in the topic
* The second user replies to the email via email

This new reply would then go and notify the other group PM users, except for those who emailed the group topic directly, which is handled via the group SMTP mailer. However because the new post already has an incoming email because it is parsed via the Email::Receiver via POP3 the group SMTP section of the post alerter is skipped, and the group's email address is not ignored for the user_private_message notification.

This PR fixes it so the group is not ever sent an email via the PM notification. This is important because any new emails in the group's IMAP inbox will be picked up by the Imap::Sync code and created as a new topic which is not at all desirable.

Also in this PR I split up the specs a bit more for group SMTP in the post alerter to make them easier to read and they each only test one thing.
2021-01-20 10:53:08 +10:00
..
spam_rule FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
anonymous_shadow_creator.rb FIX: ensures shadow has last_posted_at before comparing to site setting (#10374) 2020-08-05 13:20:51 +02:00
badge_granter.rb FIX: Check for user presence before granting badge (#11745) 2021-01-18 15:12:38 -05:00
color_scheme_revisor.rb FEATURE: User selectable color schemes (#10544) 2020-08-28 10:36:52 -04:00
destroy_task.rb PERF: avoid using destroy_all when removing stats (#11358) 2020-11-26 15:29:39 +10:00
email_style_updater.rb
group_action_logger.rb FEATURE - Moderators can create and manage groups (#10432) 2020-08-19 10:41:40 -04:00
group_mentions_updater.rb FIX: Mentions updater should work regardless of .notify 2020-02-18 16:02:26 -05:00
group_message.rb DEV: s/\$redis/Discourse\.redis (#8431) 2019-12-03 10:05:53 +01:00
handle_chunk_upload.rb
heat_settings_updater.rb
inline_uploads.rb FEATURE: Parse images in email signatures (#10137) 2020-07-08 15:50:30 +10:00
notification_consolidator.rb DEV: handle all notification consolidations in new 'NotificationConsolidator' class. 2019-12-05 14:36:06 +05:30
notification_emailer.rb FEATURE: Send notification emails when users leave do not disturb mode (#11643) 2021-01-07 10:49:49 -06:00
post_action_notifier.rb FIX: ensures we don't attempt to concat an empty list (#10600) 2020-09-04 19:08:07 +02:00
post_alerter.rb FIX: Do not email group user with user_private_message notification (#11754) 2021-01-20 10:53:08 +10:00
post_owner_changer.rb FIX: Unlike own posts on ownership transfer (#10446) 2020-08-19 09:21:02 -06:00
push_notification_pusher.rb
random_topic_selector.rb FIX: Use Discourse.system_user when we need a placeholder admin (#9781) 2020-06-24 15:51:30 +10:00
search_indexer.rb PERF: Update index for category in a background job. 2020-11-09 13:51:26 +08:00
site_settings_task.rb DEV: Apply Rubocop redundant return style 2019-11-14 15:10:51 -05:00
staff_action_logger.rb DEV: Expose silencer customization options to plugins (#11456) 2020-12-10 09:06:41 -08:00
themes_install_task.rb FIX: update theme fields when updating from ThemesInstallTask (#10143) 2020-06-29 13:49:02 -05:00
topic_status_updater.rb DEV: Split toggle topic close job (#11679) 2021-01-13 08:49:29 +10:00
topic_timestamp_changer.rb DEV: s/\$redis/Discourse\.redis (#8431) 2019-12-03 10:05:53 +01:00
tracked_topics_updater.rb
trust_level_granter.rb
user_action_manager.rb
user_activator.rb
user_anonymizer.rb DEV: Migrate Github authentication to ManagedAuthenticator (#11170) 2020-11-10 10:09:15 +00:00
user_authenticator.rb FIX: Allow signup when auth provider supplies no email 2020-07-10 17:56:33 +01:00
user_destroyer.rb FIX: when the user is deleted anonymise category post (#11551) 2020-12-23 14:19:30 +11:00
user_merger.rb PERF: run user merging task in a background job. (#10961) 2020-12-10 15:52:08 +11:00
user_notification_renderer.rb
user_silencer.rb DEV: Expose silencer customization options to plugins (#11456) 2020-12-10 09:06:41 -08:00
user_updater.rb DEV: Cleanup ignored user logic (#11107) 2020-11-03 12:38:54 +00:00
username_changer.rb
username_checker_service.rb
wildcard_domain_checker.rb SECURITY: vulnerability in WildcardUrlChecker 2019-12-13 09:29:09 -05:00
wildcard_url_checker.rb FIX: Allow any protocol in wildcard url checker (#8651) 2020-01-02 16:03:13 +00:00
word_watcher.rb