fix(chat): render quoted replies as full messages
A reply carries the author's own text, so treating it as a system post hid the content. Publish ThreadUpdated alongside the message event so the room index refreshes a topic's counters.
ZhenYi committed
Modified lib/chat/src/services/messages.rs lib/chat/src/services/messages.rs +9 −0 View lib/chat/src/services/messages.rs
@@ -578,6 +578,15 @@
578578 let dto_value = serde_json::to_value(&dto)?;
579579
580580 publish_message_event(self, room_id, seq, dto_value).await;
581 // A thread reply moves the topic's counters, but the message event alone
582 // cannot refresh them; the room index listens for this one.
583 if let Some(t) = &thread {
584 let event = RoomEvent::ThreadUpdated {
585 room_id,
586 thread_id: t.id,
587 };
588 self.realtime.publish_room(&event).await;
589 }
581590 let _ = self
582591 .sender_mark_read(caller, room_id, message_id, seq)
583592 .await;
Modified web/src/entities/chat/model/chat.ts web/src/entities/chat/model/chat.ts +5 −2 View web/src/entities/chat/model/chat.ts
@@ -116,9 +116,12 @@
116116 | { kind: 'message'; message: ChatMessage }
117117 | { kind: 'pending'; message: PendingMessage }
118118
119/** System-post kinds get their own compact rendering. */
119/**
120 * System-post kinds get their own compact rendering. A quoted reply is *not* one:
121 * it carries the author's own text plus a `reply_to_id` quote and renders as a
122 * full message row.
123 */
120124export const SYSTEM_MESSAGE_TYPES: readonly ChatMessageType[] = [
121 'Reply',
122125 'ThreadCreated',
123126 'ChannelJoin',
124127 'ChannelLeave',
Modified web/src/features/chat/ui/system-lines.ts web/src/features/chat/ui/system-lines.ts +0 −2 View web/src/features/chat/ui/system-lines.ts
@@ -20,8 +20,6 @@
2020 : t('chat.system.post', { author: label })
2121 }
2222 switch (message.message_type) {
23 case 'Reply':
24 return t('chat.system.replied', { author: who })
2523 case 'ThreadCreated':
2624 return t('chat.system.threadCreated', { author: who })
2725 case 'ChannelJoin':
Modified web/src/shared/i18n/messages/en/chat.ts web/src/shared/i18n/messages/en/chat.ts +0 −1 View web/src/shared/i18n/messages/en/chat.ts
@@ -177,7 +177,6 @@
177177 'chat.system.integration': 'Integration',
178178 'chat.system.postWithContent': '{author}: {content}',
179179 'chat.system.post': '{author} posted a message',
180 'chat.system.replied': '{author} replied to a message',
181180 'chat.system.threadCreated': '{author} started a thread',
182181 'chat.system.joined': '{author} joined this channel',
183182 'chat.system.left': '{author} left this channel',
Modified web/src/shared/i18n/messages/zh-CN/chat.ts web/src/shared/i18n/messages/zh-CN/chat.ts +0 −1 View web/src/shared/i18n/messages/zh-CN/chat.ts
@@ -177,7 +177,6 @@
177177 'chat.system.integration': '集成',
178178 'chat.system.postWithContent': '{author}:{content}',
179179 'chat.system.post': '{author} 发布了一条消息',
180 'chat.system.replied': '{author} 回复了一条消息',
181180 'chat.system.threadCreated': '{author} 开启了一个话题',
182181 'chat.system.joined': '{author} 加入了这个频道',
183182 'chat.system.left': '{author} 离开了这个频道',