mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:51:14 +08:00
DEV: allows stop/resume streaming on a message (#25774)
```ruby ChatSDK::Message.start_stream(message_id: 1, guardian: guardian) ChatSDK::Message.stream(raw: "foo", message_id: 1, guardian: guardian) ChatSDK::Message.stream(raw: "bar", message_id: 1, guardian: guardian) ChatSDK::Message.stop_stream(message_id: 1, guardian: guardian) ``` Generally speaking only admins or owners of the message can interact with a message. Also note, Streaming to an existing message with a different user won't change the initial user of the message.
This commit is contained in:
@ -48,10 +48,7 @@ module ChatSDK
|
||||
on_failed_policy(:ensure_thread_enabled) do
|
||||
raise "Threading is not enabled for this channel"
|
||||
end
|
||||
on_failure do
|
||||
p Chat::StepsInspector.new(result)
|
||||
raise "Unexpected error"
|
||||
end
|
||||
on_failure { raise "Unexpected error" }
|
||||
end
|
||||
end
|
||||
|
||||
@ -70,10 +67,7 @@ module ChatSDK
|
||||
end
|
||||
on_failed_contract { |contract| raise contract.errors.full_messages.join(", ") }
|
||||
on_success { result.thread_instance }
|
||||
on_failure do
|
||||
p Chat::StepsInspector.new(result)
|
||||
raise "Unexpected error"
|
||||
end
|
||||
on_failure { raise "Unexpected error" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user