mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Unexpected return during system_message_sent event
Followup to 0bb51dc
, should fix an issue with multiple system message events being sent
This commit is contained in:
parent
4b94af077d
commit
cfb3f4db13
@ -287,8 +287,7 @@ after_initialize do
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.on(:system_message_sent) do |args|
|
self.on(:system_message_sent) do |args|
|
||||||
return if args[:message_type] != 'tl2_promotion_message'
|
if args[:message_type] == 'tl2_promotion_message' && SiteSetting.discourse_narrative_bot_enabled
|
||||||
return if !SiteSetting.discourse_narrative_bot_enabled
|
|
||||||
|
|
||||||
raw = I18n.t("discourse_narrative_bot.tl2_promotion_message.text_body_template",
|
raw = I18n.t("discourse_narrative_bot.tl2_promotion_message.text_body_template",
|
||||||
discobot_username: ::DiscourseNarrativeBot::Base.new.discobot_username,
|
discobot_username: ::DiscourseNarrativeBot::Base.new.discobot_username,
|
||||||
@ -302,6 +301,7 @@ after_initialize do
|
|||||||
skip_validations: true
|
skip_validations: true
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
PostGuardian.class_eval do
|
PostGuardian.class_eval do
|
||||||
alias_method :existing_can_create_post?, :can_create_post?
|
alias_method :existing_can_create_post?, :can_create_post?
|
||||||
|
Loading…
Reference in New Issue
Block a user