FIX: TL2 promotion message and advance training (PR #10679)

This is a little bit of refactoring. Core Discourse should have default promotion message for TL2.

In addition, when Discobot plugin is enabled, the plugin can override the generic message and invite the user to do advanced training

GitHub

I need to ensure I remove custom message after that spec :slight_smile:

I think we should just leave the trigger as it is as other plugins might be depending on this event. If we want to remove it, we’ll have to depreciate it first.

        We’ve promoted you up a [trust level](https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/)!

Let’s move the logic here into the user model just like how we do for the other welcome messages.

Let’s just make the entire post object available to the trigger. I’ve found that to be far more versatile because we can support all form of use cases.

   DiscourseEvent.trigger(:system_message_sent, post: post, message_type: type)

Usually we prefer to not have to stub. Is it possible to set the site setting to 0?

Let us use https://github.com/discourse/discourse/blob/master/spec/support/sidekiq_helpers.rb here :slight_smile:

Same comment as https://github.com/discourse/discourse/pull/10679/files#r490659492