消息引用
描述
在 TencentCloudChatMessage 的消息列表中,您可以通过引用特定的先前消息进行回复。回复后,点击被引用的消息将跳转到原始消息,并将其高亮显示。
引用消息有两种模式:“消息引用”和“消息回复”。
消息引用:仅引用消息。消息上下文菜单中显示的文本为“引用”。
消息回复:引用并回复消息,在群聊中提及消息发送者。消息上下文菜单中显示的文本为“回复”。
效果展示
您可以在 TencentCloudChatMessage 消息列表中,长按消息引用体验效果如下:


功能说明
引用一条消息
长按消息,消息上会弹出消息工具栏。单击工具栏中的引用按钮,对该消息进行引用。


取消消息引用
在消息被引用但还未发出时,通过单击引用之后的关闭按钮,可以取消消息引用。


查看被引用消息
单击引用消息的引用内容,可以定位到原始消息,原始消息将进行高亮闪烁:
当被引用的消息处于屏幕内,单击引用消息的引用内容,只进行高亮闪烁。
当被引用的消息不处于屏幕内,但处于消息列表中时,单击引用内容,消息列表会自动滚动到原始消息处,并进行高亮闪烁。
当被引用的消息不处于屏幕内,也不处于消息列表时,单击引用内容,不会跳转到原始消息,也不会高亮闪烁。


使用方法
此模块默认自动启用。
您可以在
TencentCloudChatMessageConfig
中指定 enableReplyWithMention
以选择使用哪种引用消息模式。示例:
TencentCloudChatMessageConfig(enableReplyWithMention: ({String? groupID, String? userID, String? topicID}) => true,)