mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FEATURE: implements drafts for threads (#24483)
This commit implements drafts for threads by adding a new `thread_id` column to `chat_drafts` table. This column is used to create draft keys on the frontend which are a compound key of the channel and the thread. If the draft is only for the channel, the key will be `c-${channelId}`, if for a thread: `c-${channelId}:t-${threadId}`. This commit also moves the draft holder from the service to the channel or thread model. The current draft can now always be accessed by doing: `channel.draft` or `thread.draft`. Other notable changes of this commit: - moves ChatChannel to gjs - moves ChatThread to gjs
This commit is contained in:
@ -8,6 +8,7 @@ Chat::Engine.routes.draw do
|
||||
post "/channels" => "channels#create"
|
||||
put "/channels/read/" => "reads#update_all"
|
||||
put "/channels/:channel_id/read/:message_id" => "reads#update"
|
||||
post "/channels/:channel_id/drafts" => "channels_drafts#create"
|
||||
delete "/channels/:channel_id" => "channels#destroy"
|
||||
put "/channels/:channel_id" => "channels#update"
|
||||
get "/channels/:channel_id" => "channels#show"
|
||||
@ -38,6 +39,7 @@ Chat::Engine.routes.draw do
|
||||
get "/channels/:channel_id/threads/:thread_id" => "channel_threads#show"
|
||||
get "/channels/:channel_id/threads/:thread_id/messages" => "channel_thread_messages#index"
|
||||
put "/channels/:channel_id/threads/:thread_id/read" => "thread_reads#update"
|
||||
post "/channels/:channel_id/threads/:thread_id/drafts" => "channels_threads_drafts#create"
|
||||
put "/channels/:channel_id/threads/:thread_id/notifications-settings/me" =>
|
||||
"channel_threads_current_user_notifications_settings#update"
|
||||
|
||||
@ -78,7 +80,6 @@ Chat::Engine.routes.draw do
|
||||
post "/:chat_channel_id/:message_id/flag" => "chat#flag"
|
||||
post "/:chat_channel_id/quote" => "chat#quote_messages"
|
||||
put "/user_chat_enabled/:user_id" => "chat#set_user_chat_status"
|
||||
post "/drafts" => "chat#set_draft"
|
||||
post "/:chat_channel_id" => "api/channel_messages#create"
|
||||
put "/flag" => "chat#flag"
|
||||
get "/emojis" => "emojis#index"
|
||||
|
Reference in New Issue
Block a user