mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00

When a thread is created / a new message is created in the thread, we want to make sure that the original message user has a membership for that thread, otherwise they will not receive unread indicators for messages in the thread.
63 lines
1.8 KiB
Handlebars
63 lines
1.8 KiB
Handlebars
<div
|
|
class={{concat-class
|
|
"chat-thread"
|
|
(if this.loading "loading")
|
|
(if this.thread.staged "staged")
|
|
}}
|
|
data-id={{this.thread.id}}
|
|
{{did-insert this.setUploadDropZone}}
|
|
{{did-insert this.subscribeToUpdates}}
|
|
{{did-update this.subscribeToUpdates this.thread.id}}
|
|
{{did-insert this.loadMessages}}
|
|
{{did-update this.loadMessages this.thread}}
|
|
{{will-destroy this.unsubscribeFromUpdates}}
|
|
>
|
|
{{#if @includeHeader}}
|
|
<Chat::Thread::Header @thread={{this.thread}} @channel={{this.channel}} />
|
|
{{/if}}
|
|
|
|
<div
|
|
class="chat-thread__body popper-viewport"
|
|
{{did-insert this.setScrollable}}
|
|
{{on "scroll" this.computeScrollState passive=true}}
|
|
>
|
|
<div
|
|
class="chat-thread__messages chat-messages-container"
|
|
{{chat/on-resize this.didResizePane (hash delay=10)}}
|
|
>
|
|
{{#each this.thread.messages key="id" as |message|}}
|
|
<ChatMessage
|
|
@message={{message}}
|
|
@resendStagedMessage={{this.resendStagedMessage}}
|
|
@messageDidEnterViewport={{this.messageDidEnterViewport}}
|
|
@messageDidLeaveViewport={{this.messageDidLeaveViewport}}
|
|
@context="thread"
|
|
/>
|
|
{{/each}}
|
|
{{#if this.loading}}
|
|
<ChatSkeleton />
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
|
|
{{#if this.chatChannelThreadPane.selectingMessages}}
|
|
<ChatSelectionManager
|
|
@selectedMessageIds={{this.chatChannelThreadPane.selectedMessageIds}}
|
|
@chatChannel={{this.channel}}
|
|
@cancelSelecting={{action
|
|
this.chatChannelThreadPane.cancelSelecting
|
|
this.channel.selectedMessages
|
|
}}
|
|
@context="thread"
|
|
/>
|
|
{{else}}
|
|
<Chat::Composer::Thread
|
|
@channel={{this.channel}}
|
|
@thread={{this.thread}}
|
|
@onSendMessage={{this.onSendMessage}}
|
|
@uploadDropZone={{this.uploadDropZone}}
|
|
/>
|
|
{{/if}}
|
|
|
|
<ChatUploadDropZone @model={{this.thread}} />
|
|
</div> |