WuKongIM / WuKongIM

不只是即时通讯(IM)
https://githubim.com
Apache License 2.0
1.96k stars 287 forks source link

调用删除聊天记录的接口后,还需要调什么SDK方法来删除聊天记录呢 #132

Closed XiaoTuoLuo123456 closed 6 days ago

No8blackball commented 4 months ago

更新至1.3.6版本 然后通过WKIM.shared.messageManager .clearWithChannel(channelID, channelType);方法清空某个聊天的消息记录 同时可以通过WKIM.shared.messageManager.addOnClearChannelMsgListener("chat", (channelId, channelType) { // 刷新UI });方法监听

XiaoTuoLuo123456 commented 4 months ago

删除频道是调用哪个方法呢,WKIM.shared.conversationManager.deleteMsg(channelId, channelType);这个方法调用之后,下次进入app频道还在呢

XiaoTuoLuo123456 commented 4 months ago

置顶需要调SDK吗

tangtaoit commented 4 months ago

删除频道是调用哪个方法呢,WKIM.shared.conversationManager.deleteMsg(channelId, channelType);这个方法调用之后,下次进入app频道还在呢

你们业务服务器需要记录删除的offset 调用IM接口获取频道内的消息的时候offset大于这个 就相当于删除了

tangtaoit commented 4 months ago

置顶需要调SDK吗

不需要

XiaoTuoLuo123456 commented 4 months ago

置顶消息根据什么来排序呢

tangtaoit commented 4 months ago

置顶消息根据什么来排序呢

你是说置顶消息还是置顶会话?

如果是置顶会话 参考:https://github.com/TangSengDaoDao/TangSengDaoDaoWeb/blob/main/packages/tsdaodaobase/src/Pages/Chat/vm.ts#L186

XiaoTuoLuo123456 commented 3 months ago

更新至1.3.6版本 然后通过WKIM.shared.messageManager .clearWithChannel(channelID, channelType);方法清空某个聊天的消息记录 同时可以通过WKIM.shared.messageManager.addOnClearChannelMsgListener("chat", (channelId, channelType) { // 刷新UI });方法监听

这个方法调用后把会话也删除了?

tangtaoit commented 3 months ago

更新至1.3.6版本 然后通过WKIM.shared.messageManager .clearWithChannel(channelID, channelType);方法清空某个聊天的消息记录 同时可以通过WKIM.shared.messageManager.addOnClearChannelMsgListener("chat", (channelId, channelType) { // 刷新UI });方法监听

这个方法调用后把会话也删除了?

你需求是什么? 是不删会话吗?

XiaoTuoLuo123456 commented 3 months ago

会话

对,不删除这条会话,只删除聊天内容

No8blackball commented 3 months ago

WKIM.shared.messageManager .clearWithChannel(channelID, channelType); 这个方法只会删除聊天内容,不会删除最近会话。只是最近会话的消息内容也会清空掉,但是会话还在

XiaoTuoLuo123456 commented 3 months ago

WKIM.shared.messageManager .clearWithChannel(channelID, channelType); 这个方法只会删除聊天内容,不会删除最近会话。只是最近会话的消息内容也会清空掉,但是会话还在

但是调用clearWithChannel后,下次再进入app, 这个conversationManager.addOnRefreshMsgListener监听方法返回的列表没有那条会话了

No8blackball commented 3 months ago

WKIM.shared.messageManager .clearWithChannel(channelID, channelType); 这个方法只会删除聊天内容,不会删除最近会话。只是最近会话的消息内容也会清空掉,但是会话还在

但是调用clearWithChannel后,下次再进入app, 这个conversationManager.addOnRefreshMsgListener监听方法返回的列表没有那条会话了

你是不是清空了最近会话,我在demo上没有复现出你说的这个问题

XiaoTuoLuo123456 commented 3 months ago

WKIM.shared.messageManager .clearWithChannel(channelID, channelType); 这个方法只会删除聊天内容,不会删除最近会话。只是最近会话的消息内容也会清空掉,但是会话还在

但是调用clearWithChannel后,下次再进入app, 这个conversationManager.addOnRefreshMsgListener监听方法返回的列表没有那条会话了

你是不是清空了最近会话,我在demo上没有复现出你说的这个问题

安卓那个demo源码跟我调用的是一个方法, 我使用的是flutter ,安卓的会话还在,我这个下次再conversationManager.addOnRefreshMsgListener走这个监听方法的时候,会话不见了

No8blackball commented 3 months ago

WKIM.shared.messageManager .clearWithChannel(channelID, channelType); 这个方法只会删除聊天内容,不会删除最近会话。只是最近会话的消息内容也会清空掉,但是会话还在

但是调用clearWithChannel后,下次再进入app, 这个conversationManager.addOnRefreshMsgListener监听方法返回的列表没有那条会话了

你是不是清空了最近会话,我在demo上没有复现出你说的这个问题

安卓那个demo源码跟我调用的是一个方法, 我使用的是flutter ,安卓的会话还在,我这个下次再conversationManager.addOnRefreshMsgListener走这个监听方法的时候,会话不见了

你说的会话不见了,是当前这个页面没有这个channel的会话,还是这个channel有新消息这个回掉没有执行

XiaoTuoLuo123456 commented 3 months ago

WKIM.shared.messageManager .clearWithChannel(channelID, channelType); 这个方法只会删除聊天内容,不会删除最近会话。只是最近会话的消息内容也会清空掉,但是会话还在

但是调用clearWithChannel后,下次再进入app, 这个conversationManager.addOnRefreshMsgListener监听方法返回的列表没有那条会话了

你是不是清空了最近会话,我在demo上没有复现出你说的这个问题

安卓那个demo源码跟我调用的是一个方法, 我使用的是flutter ,安卓的会话还在,我这个下次再conversationManager.addOnRefreshMsgListener走这个监听方法的时候,会话不见了

你说的会话不见了,是当前这个页面没有这个channel的会话,还是这个channel有新消息这个回掉没有执行

就是执行WKIM.shared.messageManager .clearWithChannel(channelID, channelType);这个方法删除某个channel的聊天记录后. 杀掉程序,再次执行程序,通过conversationManager.addOnRefreshMsgListener监听方法去获取会话列表的话,监听方法没有被删除聊天记录的那个channel了

No8blackball commented 3 months ago

再次执行程序,通过conversationManager.addOnRefr

你先试下flutter的example,我在demo上没有复现出来

XiaoTuoLuo123456 commented 3 months ago

再次执行程序,通过conversationManager.addOnRefr

你先试下flutter的example,我在demo上没有复现出来

麻烦再问下,删除会话是哪个方法呢

No8blackball commented 3 months ago

再次执行程序,通过conversationManager.addOnRefr

你先试下flutter的example,我在demo上没有复现出来

麻烦再问下,删除会话是哪个方法呢

WKIM.shared.conversationManager.deleteMsg(channelID, channelType);

XiaoTuoLuo123456 commented 3 months ago

WKChannelMember ? member = await WKIM.shared.channelMemberManager.getMember(channelId, channelType, fromUid); 这个方法为什么获取到的member为null呢?

tangtaoit commented 6 days ago

WKChannelMember ? member = await WKIM.shared.channelMemberManager.getMember(channelId, channelType, fromUid); 这个方法为什么获取到的member为null呢?

这个问题请另外开一个issue