mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:01:14 +08:00
FIX: adds back recurring to send_message automation (#18990)
Also uses new way to get channel title
This commit is contained in:
@ -83,10 +83,6 @@ class ChatChannel < ActiveRecord::Base
|
|||||||
"/chat/channel/#{self.id}/#{self.slug || "-"}"
|
"/chat/channel/#{self.id}/#{self.slug || "-"}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def public_channel_title
|
|
||||||
chatable.name
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def change_status(acting_user, target_status)
|
def change_status(acting_user, target_status)
|
||||||
|
@ -675,13 +675,13 @@ after_initialize do
|
|||||||
|
|
||||||
placeholder :channel_name
|
placeholder :channel_name
|
||||||
|
|
||||||
|
triggerables [:recurring]
|
||||||
|
|
||||||
script do |context, fields, automation|
|
script do |context, fields, automation|
|
||||||
sender = User.find_by(username: fields.dig("sender", "value")) || Discourse.system_user
|
sender = User.find_by(username: fields.dig("sender", "value")) || Discourse.system_user
|
||||||
channel = ChatChannel.find_by(id: fields.dig("chat_channel_id", "value"))
|
channel = ChatChannel.find_by(id: fields.dig("chat_channel_id", "value"))
|
||||||
|
|
||||||
placeholders = { channel_name: channel.public_channel_title }.merge(
|
placeholders = { channel_name: channel.title(sender) }.merge(context["placeholders"] || {})
|
||||||
context["placeholders"] || {},
|
|
||||||
)
|
|
||||||
|
|
||||||
creator =
|
creator =
|
||||||
Chat::ChatMessageCreator.create(
|
Chat::ChatMessageCreator.create(
|
||||||
|
Reference in New Issue
Block a user