FIX: Do not send emails to mailing_list_mode subscribers for PMs (PR #14159)

This bug was introduced by f66007ec83b62169b5c41016eecd40c72f27028f.

In PostJobsEnqueuer we previously did not fire the after_post_create event and after_topic_create event for private message topics. This was changed in the above commit in order to publish message bus messages for topic tracking state updates. Unfortunately this caused the NotifyMailingListSubscribers job to be enqueued for all posts including private messages, and admins and the users involved in the PMs got emailed the contents of the PMs if they had mailing list mode enabled.

Luckily the impact of this was mitigated by a Guardian#can_see? check for each mailing list mode user in the NotifyMailingListSubscribers job. We never want to notify mailing list mode subscribers for private messages so an early return has been added there, plus the logic in PostJobsEnqueuer has been fixed, and tests have been added to that class where there were none before.

GitHub