public interface MsgService
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
MSG_CHATTING_ACCOUNT_ALL
目前没有与任何人对话,但能看到消息提醒(比如在消息列表界面),不需要在状态栏做消息通知
|
static java.lang.String |
MSG_CHATTING_ACCOUNT_NONE
目前没有与任何人对话,需要状态栏消息通知
|
| 限定符和类型 | 方法和说明 |
|---|---|
InvocationFuture<CollectInfo> |
addCollect(int type,
java.lang.String date,
java.lang.String ext,
java.lang.String uniqueId)
添加一条收藏
|
InvocationFuture<java.lang.Long> |
addMsgPin(IMMessage msg,
java.lang.String ext)
PIN一条消息
|
InvocationFuture<java.lang.Void> |
addQuickComment(IMMessage msg,
long replyType,
java.lang.String ext)
增加一条快捷评论
|
InvocationFuture<java.lang.Long> |
addQuickComment(IMMessage msg,
long replyType,
java.lang.String ext,
boolean needPush,
boolean needBadge,
java.lang.String pushTitle,
java.lang.String pushContent,
java.util.Map<java.lang.String,java.lang.Object> pushPayload)
增加一条快捷评论
|
InvocationFuture<StickTopSessionInfo> |
addStickTopSession(java.lang.String sessionId,
SessionTypeEnum sessionType,
java.lang.String ext)
添加一个置顶会话
|
InvocationFuture<java.lang.Void> |
cancelUploadAttachment(IMMessage imMessage)
取消上传消息附件(图片、视频、文件类型的),如果附件已经上传成功,操作将会失败 。
|
LocalAntiSpamResult |
checkLocalAntiSpam(java.lang.String content,
java.lang.String replacement)
检验本地反垃圾词库
|
void |
clearAllUnreadCount()
将所有联系人的未读数清零(标记已读)
调用该接口后,会触发
MsgServiceObserve.observeRecentContact(Observer, boolean) 通知 |
void |
clearChattingHistory(java.lang.String account,
SessionTypeEnum sessionType)
清除与指定用户的所有消息记录,且不在数据库记录此次操作
|
void |
clearChattingHistory(java.lang.String account,
SessionTypeEnum sessionType,
boolean ignore)
清除与指定用户的所有本地消息记录
|
InvocationFuture<java.lang.Void> |
clearMsgDatabase(boolean clearRecent)
清空消息数据库的所有消息记录。
|
void |
clearServerHistory(java.lang.String sessionId,
boolean deleteRoam)
清空点对点历史消息
|
void |
clearServerHistory(java.lang.String sessionId,
SessionTypeEnum sessionType)
清空点对点历史消息,默认删除漫游消息
|
void |
clearServerHistory(java.lang.String sessionId,
SessionTypeEnum sessionType,
boolean deleteRoam)
已过时。
仅当P2P时,支持保留漫游消息。
如果要保留漫游消息,使用
clearServerHistory(String, boolean)
如果不保留蛮有消息,使用clearServerHistory(String, SessionTypeEnum) |
void |
clearServerHistory(java.lang.String sessionId,
SessionTypeEnum sessionType,
boolean sync,
java.lang.String ext)
清空历史消息
|
InvocationFuture<java.util.List<SessionAckInfo>> |
clearUnreadCount(java.util.List<<any>> sessionKeyList)
将指定最近联系人的未读数清零(标记已读)。
|
InvocationFuture<java.util.List<SessionAckInfo>> |
clearUnreadCount(SessionTypeEnum sessionType)
将指定会话类型的未读数清零(标记已读)。
|
InvocationFuture<java.lang.Void> |
clearUnreadCount(java.lang.String account,
SessionTypeEnum sessionType)
将指定最近联系人的未读数清零(标记已读)。
|
RecentContact |
createEmptyRecentContact(java.lang.String contactId,
SessionTypeEnum sessionType,
long tag,
long time,
boolean saveToDB)
创建一条空的联系人会话
|
RecentContact |
createEmptyRecentContact(java.lang.String contactId,
SessionTypeEnum sessionType,
long tag,
long time,
boolean saveToDB,
boolean withLastMsg)
创建一条空的联系人会话
|
void |
deleteChattingHistory(IMMessage message)
删除一条消息记录,并在数据库记录此操作
从云端拉取消息时,如果本地有删除该消息的操作记录,则该消息不会入库
删除标记会被清除标记覆盖
|
void |
deleteChattingHistory(IMMessage message,
boolean ignore)
删除一条消息记录
|
void |
deleteChattingHistory(java.util.List<IMMessage> msgList,
boolean ignore)
删除多条消息记录
|
InvocationFuture<java.lang.Long> |
deleteMsgSelf(IMMessage msg,
java.lang.String ext)
单向删除一条消息
|
InvocationFuture<java.lang.Long> |
deleteMsgSelf(java.util.List<IMMessage> msgList,
java.lang.String ext)
单向删除多条消息
|
InvocationFuture<java.lang.Void> |
deleteMySession(java.lang.String[] sessionIdArr)
【会话服务】删除会话
|
void |
deleteRangeHistory(java.lang.String account,
SessionTypeEnum sessionType,
long startTime,
long endTime)
根据时间范围删除本地历史消息(startTime, entTime), 开区间,不包括两个端点,大于startTime, 小于endTime
|
void |
deleteRecentContact(RecentContact recent)
从最近联系人会话列表中删除一项,既删本地也删漫游。
|
InvocationFuture<java.lang.Void> |
deleteRecentContact(java.lang.String account,
SessionTypeEnum sessionType,
DeleteTypeEnum deleteType,
boolean sendAck)
删除最近联系人记录。
|
void |
deleteRecentContact2(java.lang.String account,
SessionTypeEnum sessionType)
删除最近联系人记录,既删本地也删漫游。
|
InvocationFuture<java.lang.Void> |
deleteRoamingRecentContact(java.lang.String contactId,
SessionTypeEnum sessionTypeEnum)
删除指定最近联系人的漫游消息。
|
void |
deleteRoamMsgHasMoreTag(java.lang.String sessionId,
SessionTypeEnum sessionType)
删除是否有更多漫游的标记
|
AbortableFuture<java.lang.Void> |
downloadAttachment(IMMessage msg,
boolean thumb)
正常情况收到消息后附件会自动下载。
|
boolean |
everBeenDeleted(IMMessage message)
消息是否曾被从本地删除
|
AbortableFuture<java.lang.Void> |
exportAllMessage(IMsgExportProcessor exportProcessor,
boolean safeMode)
导出本地db 的所有消息并上传给服务器,对应于导入消息的操作(常用于端到端的历史消息牵移),如果有云端消息记录,不建议使用这个接口
导入参考 importAllMessage(IMsgImportProcessor, boolean safeMode)只会导出以下类型的消息:文本消息 、图片消息、 音频消息、 视频消息 、文件消息、自定义消息 整个过程如下: step1 : 消息转换成文件 step2 : 压缩文件(用户自定义过程) step3 : 加密文件(用户自定义过程) step4 : 上传文件 错误码: DB中没有数据 : MigrationConstant.EXPORT_ERR_DB_EMPTY本地消息格式化失败 : MigrationConstant.EXPORT_ERR_LOCAL_FORMAT文件压缩失败(用户自定义过程) : MigrationConstant.EXPORT_ERR_USER_CUSTOM_ZIP消息导出时,文件加密失败(用户自定义过程) : MigrationConstant.EXPORT_ERR_USER_CUSTOM_ENCRYPT上传文件失败 : MigrationConstant.EXPORT_ERR_UPLOAD_FILE消息导出时,本地有消息,但是都被过滤了 : MigrationConstant.EXPORT_ERR_EMPTY_AFTER_FILTER |
InvocationFuture<GetMessagesDynamicallyResult> |
getMessagesDynamically(GetMessagesDynamicallyParam param)
动态途径获取消息,默认从本地获取,动态能力需要开通功能,并在同步完成后生效
|
int |
getTotalUnreadCount()
获取未读数总数
|
int |
getTotalUnreadCount(boolean notify)
获取未读数总数
|
int |
getUnreadCountBySessionType(SessionTypeEnum sessionType)
获取指定会话类型的总未读数
|
AbortableFuture<java.lang.Void> |
importAllMessage(IMsgImportProcessor iMsgImportProcessor,
boolean safeMode)
导入已经导出的消息(常用于端到端的历史消息牵移) ,导出参考
exportAllMessage(IMsgExportProcessor, boolean safeMode)* 整个过程如下: step1 : 请求服务器,下载备份文件 step2 : 解密文件(用户自定义过程) step3 : 解压缩文件(用户自定义过程) step4 : 解析文件 错误码: 服务端上没有备份记录 : MigrationConstant.IMPORT_ERR_NO_BACKUP服务端返回了备份记录,可是为空 : MigrationConstant.IMPORT_ERR_RECORD_EMPTY文件下载失败 : MigrationConstant.IMPORT_ERR_DOWN_FILE文件解密失败(用户自定义过程) : MigrationConstant.IMPORT_ERR_CUSTOM_DECRYPT文件解压缩失败(用户自定义过程) : MigrationConstant.IMPORT_ERR_CUSTOM_UNZIP文件格式错误 : MigrationConstant.IMPORT_ERR_FILE_FORMAT部分成功: MigrationConstant.IMPORT_ERR_PART_SUCCESS |
InvocationFuture<java.lang.Void> |
importRecentSessions(java.util.List<<any>> sessions)
导入最近会话,批量导入,仅支持 contactId 和 sessionType 两个字段
|
InvocationFuture<java.lang.Void> |
insertLocalMessage(IMMessage msg,
java.lang.String fromAccount)
插入消息到本地数据库,且通知更新UI界面,但不发送到服务器端。
|
boolean |
isStickTopSession(java.lang.String sessionId,
SessionTypeEnum sessionType)
会话是否被置顶,若参数不合法,或者会话不存在,返回false
|
void |
migrateMessages(java.lang.String from,
java.lang.String to,
boolean changeFrom)
迁移消息聊天记录。
|
InvocationFuture<java.util.List<IMMessage>> |
pullHistoryById(java.util.List<MessageKey> msgKeyList,
boolean persist)
根据消息ID等信息从服务器批量查询历史消息
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistory(IMMessage anchor,
int limit,
boolean persist)
从服务器拉取消息历史记录。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistory(IMMessage anchor,
int limit,
boolean persist,
boolean persistClear)
从服务器拉取消息历史记录。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistory(MsgFullKeywordSearchConfig config)
云端历史消息全文检索
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryEx(IMMessage anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
boolean persist)
从服务器拉取消息历史记录。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryExType(IMMessage anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
MsgTypeEnum[] msgTypes)
从服务器拉取消息历史记录,可以指定查询的消息类型,结果不存本地消息数据库。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryExType(IMMessage anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
MsgTypeEnum[] msgTypes,
boolean persist)
从服务器拉取消息历史记录,可以指定查询的消息类型,结果是否保存到本地消息数据库。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryExType(IMMessage anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
MsgTypeEnum[] msgTypes,
boolean persist,
boolean persistClear)
从服务器拉取消息历史记录,可以指定查询的消息类型,结果不存本地消息数据库。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryExType(IMMessage anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
MsgTypeEnum[] msgTypes,
boolean persist,
boolean persistClear,
IMMessageFilter customFilter)
从服务器拉取消息历史记录,可以指定查询的消息类型,结果不存本地消息数据库。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryExType(IMMessage anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
MsgTypeEnum[] msgTypes,
boolean persist,
boolean persistClear,
IMMessageFilter customFilter,
boolean updateUnread)
从服务器拉取消息历史记录,可以指定查询的消息类型,结果不存本地消息数据库。
|
InvocationFuture<java.util.List<IMMessage>> |
pullMessageHistoryOrderByTime(MsgTimingFullKeywordSearchConfig config)
云端历史消息全文检索(按时间排序,不按会话分组)
|
InvocationFuture<CollectInfoPage> |
queryCollect(CollectInfo anchor,
long toTime,
int limit,
QueryDirectionEnum direction)
从服务端分页查询收藏列表
|
InvocationFuture<CollectInfoPage> |
queryCollect(CollectInfo anchor,
long toTime,
int limit,
QueryDirectionEnum direction,
int type,
boolean persist)
从服务的分页查询收藏列表
|
InvocationFuture<CollectInfoPage> |
queryCollect(int limit)
从服务查询收藏列表
|
IMMessage |
queryLastMessage(java.lang.String account,
SessionTypeEnum sessionType)
查询同指定用户的最近一条消息
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageList(java.lang.String account,
SessionTypeEnum sessionType,
long offset,
int limit)
|
java.util.List<IMMessage> |
queryMessageListByServerIdBlock(java.util.List<java.lang.String> serverIds)
通过 Server ID 批量获取IMMessage(同步版本)
注意:一个ServerId可能对应多条消息
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListBySubtype(MsgTypeEnum msgTypeEnum,
IMMessage anchor,
int limit,
int subtype)
通过消息子类型查询本地消息记录(异步版本)
|
java.util.List<IMMessage> |
queryMessageListBySubtypeBlock(MsgTypeEnum msgTypeEnum,
IMMessage anchor,
int limit,
int subtype)
通过消息子类型查询本地消息记录(同步版本)
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListByType(MsgTypeEnum msgTypeEnum,
IMMessage anchor,
int limit)
通过消息类型从本地消息数据库中查询消息历史。
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListByType(MsgTypeEnum msgTypeEnum,
java.lang.Long maxTime,
int limit)
通过消息类型查询所有消息记录,
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListByTypes(java.util.List<MsgTypeEnum> types,
IMMessage anchor,
long toTime,
QueryDirectionEnum direction,
int limit,
boolean asc)
已过时。
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListByTypesV2(java.util.List<MsgTypeEnum> types,
IMMessage anchor,
long toTime,
QueryDirectionEnum direction,
int limit,
boolean asc)
根据起始、截止时间点以及查询方向从本地消息数据库中查询指定消息类型的消息历史。
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListByUuid(java.util.List<java.lang.String> uuids)
通过uuid批量获取IMMessage
|
java.util.List<IMMessage> |
queryMessageListByUuidBlock(java.util.List<java.lang.String> uuids)
通过uuid批量获取IMMessage(同步版本)
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListEx(IMMessage anchor,
QueryDirectionEnum direction,
int limit,
boolean asc)
根据锚点和方向从本地消息数据库中查询消息历史。
|
java.util.List<IMMessage> |
queryMessageListExBlock(IMMessage anchor,
QueryDirectionEnum direction,
int limit,
boolean asc)
根据锚点和方向从本地消息数据库中查询消息历史。
|
InvocationFuture<java.util.List<IMMessage>> |
queryMessageListExTime(IMMessage anchor,
long toTime,
QueryDirectionEnum direction,
int limit)
根据起始、截止时间点以及查询方向从本地消息数据库中查询消息历史。
|
java.util.List<MsgPinDbOption> |
queryMsgPinBlock(java.lang.String sessionId,
SessionTypeEnum sessionType)
本地获取会话的PIN消息列表
|
InvocationFuture<RecentSession> |
queryMySession(java.lang.String sessionId)
【会话服务】获取某一个会话
|
InvocationFuture<RecentSessionList> |
queryMySessionList(long minTimestamp,
java.lang.Long maxTimestamp,
java.lang.Integer needLastMsg,
java.lang.Integer limit,
java.lang.Integer hasMore)
已过时。
|
InvocationFuture<RecentSessionList> |
queryMySessionList(QueryMySessionOption option)
【会话服务】增量获取会话列表,增量+翻页
|
InvocationFuture<java.util.List<QuickCommentOptionWrapper>> |
queryQuickComment(java.util.List<IMMessage> msgList)
获取快捷评论列表
|
RecentContact |
queryRecentContact(java.lang.String contactId,
SessionTypeEnum sessionType)
根据 contactId 与 sessionType 从db 中查询联系人会话记录。
|
InvocationFuture<java.util.List<RecentContact>> |
queryRecentContacts()
查询最近联系人会话列表数据
|
InvocationFuture<java.util.List<RecentContact>> |
queryRecentContacts(int limit)
查询最近联系人会话列表数据, 可以设置limit, 防止本地会话过多时,导致第一次加载慢
|
InvocationFuture<java.util.List<RecentContact>> |
queryRecentContacts(MsgTypeEnum filterMsgType)
查询联系人最近会话列表数据, 最近一条不等于过滤消息类型, eg: 需要过滤MsgTypeEnum.notification, 则传入改type
note :该方法返回未读为全量消息未读
|
InvocationFuture<java.util.List<RecentContact>> |
queryRecentContacts(RecentContact anchor,
QueryDirectionEnum direction,
int limit)
查询最近联系人会话列表数据,可按时间逆序或者正序查询指定数量的最新会话列表数据
|
InvocationFuture<java.util.List<RecentContact>> |
queryRecentContacts(java.util.Set<MsgTypeEnum> filterMsgTypeSet)
查询联系人最近会话列表数据, 最近一条不在过滤消息类型中, eg: 需要过滤MsgTypeEnum.notification, 则传入改type
note :该方法返回未读为全量消息未读
|
java.util.List<RecentContact> |
queryRecentContactsBlock()
查询最近联系人会话列表数据(同步版本)
|
java.util.List<RecentContact> |
queryRecentContactsBlock(int limit)
查询最近联系人会话列表数据(同步版本),可以设置limit, 防止本地会话过多时,导致第一次加载慢
|
java.util.List<RecentContact> |
queryRecentContactsBlock(MsgTypeEnum filterMsgType)
查询联系人最近会话列表数据(同步版本), 最近一条不等于过滤消息类型, 该方法可能会执行较长时间,建议使用异步版本,
note :该方法返回未读为全量消息未读
|
java.util.List<RecentContact> |
queryRecentContactsBlock(RecentContact anchor,
QueryDirectionEnum direction,
int limit)
查询最近联系人会话列表数据(同步版本),可按时间逆序或者正序查询指定数量的最新会话列表数据
|
java.util.List<RecentContact> |
queryRecentContactsBlock(java.util.Set<MsgTypeEnum> filterMsgTypeSet)
查询联系人最近会话列表数据(同步版本), 最近一条不在过滤消息类型中, 该方法可能会执行较长时间,建议使用异步版本,
note :该方法返回未读为全量消息未读
|
int |
queryReplyCountInThreadTalkBlock(IMMessage msg)
本地获取某thread消息的回复消息的条数,thread消息不被计入总数
|
InvocationFuture<java.lang.Long> |
queryRoamMsgHasMoreTagServerId(java.lang.String sessionId,
SessionTypeEnum sessionType)
获取是否有更多漫游消息标记的serverid,如果没有,回调0L
|
long |
queryRoamMsgHasMoreTagServerIdBlock(java.lang.String sessionId,
SessionTypeEnum sessionType)
获取是否有更多漫游消息标记的serverid,如果没有,回调0L(同步接口)
|
InvocationFuture<java.lang.Long> |
queryRoamMsgHasMoreTime(java.lang.String sessionId,
SessionTypeEnum sessionType)
获取是否有更多漫游消息标记的时间戳,如果没有,回调0L
|
long |
queryRoamMsgHasMoreTimeBlock(java.lang.String sessionId,
SessionTypeEnum sessionType)
获取是否有更多漫游消息标记的时间戳,如果没有,回调0L(同步接口)
|
java.util.List<StickTopSessionInfo> |
queryStickTopSessionBlock()
获取置顶会话信息的列表
|
InvocationFuture<ThreadTalkHistory> |
queryThreadTalkHistory(IMMessage anchor,
long fromTime,
long toTime,
int limit,
QueryDirectionEnum direction,
boolean persist)
查询thread聊天云端历史(支持p2p、群、超大群)
|
InvocationFuture<java.util.List<IMMessage>> |
queryUnreadMessageList(java.lang.String sessionId,
SessionTypeEnum sessionType)
根据会话ID和会话类型查找未读消息列表
|
java.util.List<IMMessage> |
queryUnreadMessageListBlock(java.lang.String sessionId,
SessionTypeEnum sessionType)
根据会话ID和会话类型查找未读消息列表(同步版本)
|
void |
registerCustomAttachmentParser(MsgAttachmentParser customParser)
如果第三方app需要自定义的附件消息类型,再次注册自己的附件解析器。
|
void |
registerIMMessageFilter(IMMessageFilter filter)
注册通知消息过滤器
|
void |
registerShouldShowNotificationWhenRevokeFilter(ShowNotificationWhenRevokeFilter filter)
注册是否在撤回消息时展示通知的过滤器
|
InvocationFuture<java.lang.Integer> |
removeCollect(java.util.List<<any>> collectInfo)
批量移除收藏
|
InvocationFuture<java.lang.Long> |
removeMsgPin(IMMessage msg,
java.lang.String ext)
移除一条消息的PIN
|
InvocationFuture<java.lang.Void> |
removeQuickComment(IMMessage msg,
long replyType,
java.lang.String ext)
删除一条快捷评论
|
InvocationFuture<java.lang.Long> |
removeQuickComment(IMMessage msg,
long replyType,
java.lang.String ext,
boolean needPush,
boolean needBadge,
java.lang.String pushTitle,
java.lang.String pushContent,
java.util.Map<java.lang.String,java.lang.Object> pushPayload)
删除一条快捷评论
|
InvocationFuture<java.lang.Void> |
removeStickTopSession(java.lang.String sessionId,
SessionTypeEnum sessionType,
java.lang.String ext)
删除一个置顶会话
|
InvocationFuture<java.lang.Void> |
replyMessage(IMMessage msg,
IMMessage replyMsg,
boolean resend)
回复消息。
|
InvocationFuture<java.lang.Void> |
revokeMessage(IMMessage message)
消息撤回 ,默认没有第三方推送(包括IOS平台的推送),参考
revokeMessageEx(IMMessage, String, Map) |
InvocationFuture<java.lang.Void> |
revokeMessage(IMMessage message,
java.lang.String customApnsText,
java.util.Map<java.lang.String,java.lang.Object> pushPayload,
boolean shouldNotifyBeCount)
消息撤回 , 并设置相应的第三方推送配置(包括IOS平台的推送)与未读数变化,如果想要关闭App内的返回消息提醒,参考
NIMClient.toggleRevokeMessageNotification(boolean on) |
InvocationFuture<java.lang.Void> |
revokeMessage(IMMessage message,
java.lang.String customApnsText,
java.util.Map<java.lang.String,java.lang.Object> pushPayload,
boolean shouldNotifyBeCount,
java.lang.String postscript)
消息撤回 , 并设置相应的第三方推送配置(包括IOS平台的推送)与未读数变化,如果想要关闭App内的返回消息提醒,参考
NIMClient.toggleRevokeMessageNotification(boolean on) |
InvocationFuture<java.lang.Void> |
revokeMessage(IMMessage message,
java.lang.String customApnsText,
java.util.Map<java.lang.String,java.lang.Object> pushPayload,
boolean shouldNotifyBeCount,
java.lang.String postscript,
java.lang.String attach)
消息撤回 , 并设置相应的第三方推送配置(包括IOS平台的推送)与未读数变化,如果想要关闭App内的返回消息提醒,参考
NIMClient.toggleRevokeMessageNotification(boolean on) |
InvocationFuture<java.lang.Void> |
revokeMessageEx(IMMessage message,
java.lang.String customApnsText,
java.util.Map<java.lang.String,java.lang.Object> pushPayload)
消息撤回 , 并设置相应的第三方推送配置(包括IOS平台的推送),如果想要关闭App内的返回消息提醒,参考
NIMClient.toggleRevokeMessageNotification(boolean on) |
InvocationFuture<java.lang.Void> |
saveMessageToLocal(IMMessage msg,
boolean notify)
保存消息到本地数据库,但不发送到服务器端。
|
InvocationFuture<java.lang.Void> |
saveMessageToLocalEx(IMMessage msg,
boolean notify,
long time)
保存消息到本地数据库,但不发送到服务器端。
|
InvocationFuture<java.util.List<IMMessage>> |
searchAllMessage(MsgSearchOption option)
从本地消息数据库全局搜索消息历史。
|
InvocationFuture<java.util.List<IMMessage>> |
searchAllMessageHistory(java.lang.String keyword,
java.util.List<java.lang.String> fromAccounts,
long time,
int limit)
从本地消息数据库搜索消息历史。
|
InvocationFuture<java.util.List<MsgIndexRecord>> |
searchAllSession(java.lang.String query,
int limit)
检索所有会话,返回每个会话与检索串匹配的消息数及最近一条匹配的消息记录。
|
java.util.List<MsgIndexRecord> |
searchAllSessionBlock(java.lang.String query,
int limit)
检索所有会话,返回每个会话与检索串匹配的消息数及最近一条匹配的消息记录。
|
InvocationFuture<java.util.List<IMMessage>> |
searchMessage(SessionTypeEnum sessionType,
java.lang.String sessionId,
MsgSearchOption option)
从本地消息数据库搜索消息历史。
|
InvocationFuture<java.util.List<IMMessage>> |
searchMessageHistory(java.lang.String keyword,
java.util.List<java.lang.String> fromAccounts,
IMMessage anchor,
int limit)
从本地消息数据库搜索消息历史。
|
InvocationFuture<java.util.List<IMMessage>> |
searchMessageHistory(java.lang.String keyword,
java.util.List<java.lang.String> fromAccounts,
IMMessage anchor,
QueryDirectionEnum direction,
int limit)
从本地消息数据库搜索消息历史。
|
InvocationFuture<java.util.ArrayList<IMMessage>> |
searchRoamingMsg(java.lang.String otherAccid,
long fromTime,
long endTime,
java.lang.String keyword,
int limit,
boolean reverse)
云端聊天记录关键词查询
|
InvocationFuture<java.util.List<MsgIndexRecord>> |
searchSession(java.lang.String query,
SessionTypeEnum sessionType,
java.lang.String sessionId)
检索指定的会话,返回该会话中与检索串匹配的所有消息记录。
|
java.util.List<MsgIndexRecord> |
searchSessionBlock(java.lang.String query,
SessionTypeEnum sessionType,
java.lang.String sessionId)
检索指定的会话,返回该会话中与检索串匹配的所有消息记录。
|
InvocationFuture<java.lang.Void> |
sendCustomNotification(CustomNotification notification)
发送一条指令消息。
|
AbortableFuture<FileAttachment> |
sendFile(FileAttachment attachment)
上传文件附件
|
InvocationFuture<java.lang.Void> |
sendMessage(IMMessage msg,
boolean resend)
发送消息。
|
InvocationFuture<java.lang.Void> |
sendMessageReceipt(java.lang.String sessionId,
IMMessage message)
发送P2P消息已读回执
|
void |
setChattingAccount(java.lang.String account,
SessionTypeEnum sessionType)
设置当前正在聊天的对象。
|
InvocationFuture<MsgPinSyncResponseOptionWrapper> |
syncMsgPin(SessionTypeEnum sessionType,
java.lang.String sessionId,
long timestamp)
同步会话的PIN信息
|
AbortableFuture<java.lang.String> |
transVoiceToText(java.lang.String voiceUrl,
java.lang.String path,
long duration)
语音转文字
|
AbortableFuture<java.lang.String> |
transVoiceToTextAtScene(java.lang.String voiceUrl,
java.lang.String path,
long duration,
java.lang.String sceneKey)
语音转文字并指定上传文件的场景
|
AbortableFuture<java.lang.String> |
transVoiceToTextEnableForce(java.lang.String voiceUrl,
java.lang.String path,
long duration,
java.lang.String sceneKey,
boolean enableForceUploadFile)
语音转文字并指定上传文件的场景以及是否要强制重新上传文件
|
InvocationFuture<CollectInfo> |
updateCollect(CollectInfo info,
java.lang.String ext)
更新一个收藏的扩展字段
|
InvocationFuture<CollectInfo> |
updateCollect(long infoId,
long createTime,
java.lang.String ext)
更新一个收藏的扩展字段
|
void |
updateIMMessage(IMMessage message)
更新消息。
|
void |
updateIMMessageStatus(IMMessage message)
更新消息记录的状态。
|
InvocationFuture<java.lang.Long> |
updateMsgPin(IMMessage msg,
java.lang.String ext)
更新一条消息的PIN
|
InvocationFuture<java.lang.Void> |
updateMySession(java.lang.String sessionId,
java.lang.String ext)
【会话服务】更新某一个会话,主要是设置会话的ext字段,如果会话不存在,则会创建出来,此时会话没有lastMsg
|
void |
updateRecent(RecentContact recent)
更新一条最近联系人会话的属性。
|
void |
updateRecentAndNotify(RecentContact recent)
更新一条最近联系人会话的属性,并会触发
MsgServiceObserve.observeRecentContact(Observer, boolean)的通知 。 |
void |
updateRecentByMessage(IMMessage message,
boolean needNotify)
通过消息更新一条最近联系人会话。
|
void |
updateRoamMsgHasMoreTag(IMMessage newTag)
更新是否有更多漫游消息的标记
|
InvocationFuture<StickTopSessionInfo> |
updateStickTopSession(java.lang.String sessionId,
SessionTypeEnum sessionType,
java.lang.String ext)
更新一个会话在置顶上的扩展字段
|
static final java.lang.String MSG_CHATTING_ACCOUNT_ALL
static final java.lang.String MSG_CHATTING_ACCOUNT_NONE
InvocationFuture<java.lang.Void> sendMessage(IMMessage msg, boolean resend)
MsgServiceObserve.observeMsgStatus(com.netease.nimlib.sdk.Observer, boolean)msg - 带发送的消息体,由MessageBuilder构造resend - 如果是发送失败后重发,标记为true,否则填falseInvocationFuture<java.lang.Void> replyMessage(IMMessage msg, IMMessage replyMsg, boolean resend)
MsgServiceObserve.observeMsgStatus(com.netease.nimlib.sdk.Observer, boolean)msg - 带发送的消息体,由MessageBuilder构造replyMsg - 被回复的消息resend - 如果是发送失败后重发,标记为true,否则填falseAbortableFuture<FileAttachment> sendFile(FileAttachment attachment)
InvocationFuture<java.lang.Void> insertLocalMessage(IMMessage msg, java.lang.String fromAccount)
MsgServiceObserve.observeReceiveMessage(Observer, boolean)通知。msg - 待保存的消息对象fromAccount - 发送者IDInvocationFuture<java.lang.Void> saveMessageToLocal(IMMessage msg, boolean notify)
MsgServiceObserve.observeReceiveMessage(Observer, boolean)通知。msg - 待保存的消息对象notify - 是否要通知UI更新界面InvocationFuture<java.lang.Void> saveMessageToLocalEx(IMMessage msg, boolean notify, long time)
MsgServiceObserve.observeReceiveMessage(Observer, boolean)通知。msg - 待保存的消息对象notify - 是否要通知UI更新界面time - 保存消息的时间, 使用NIMMessage.getTime()AbortableFuture<java.lang.Void> downloadAttachment(IMMessage msg, boolean thumb)
msg - 附件所在的消息体thumb - 下载缩略图还是原文件。为true时,仅下载缩略图。java.util.List<IMMessage> queryMessageListByUuidBlock(java.util.List<java.lang.String> uuids)
uuids - 消息的uuid列表InvocationFuture<java.util.List<IMMessage>> queryMessageListByUuid(java.util.List<java.lang.String> uuids)
uuids - 消息的uuid列表java.util.List<IMMessage> queryMessageListByServerIdBlock(java.util.List<java.lang.String> serverIds)
serverIds - 消息的Server ID列表InvocationFuture<java.util.List<IMMessage>> queryMessageListByType(MsgTypeEnum msgTypeEnum, IMMessage anchor, int limit)
msgTypeEnum - 消息类型anchor - 搜索的消息锚点limit - 搜索结果的条数限制InvocationFuture<java.util.List<IMMessage>> queryMessageListByType(MsgTypeEnum msgTypeEnum, java.lang.Long maxTime, int limit)
maxTime - 查询开始时间, 开区间, 往后或者limit条, 如果maxTime为空表示查询所有记录msgTypeEnum - 消息类型limit - 每次获取条数, limit<=0 返回参数错误java.util.List<IMMessage> queryMessageListBySubtypeBlock(MsgTypeEnum msgTypeEnum, IMMessage anchor, int limit, int subtype)
msgTypeEnum - 消息类型anchor - 搜索的消息锚点limit - 搜索结果的条数限制subtype - 子类型InvocationFuture<java.util.List<IMMessage>> queryMessageListBySubtype(MsgTypeEnum msgTypeEnum, IMMessage anchor, int limit, int subtype)
subtype - 子类型anchor - 搜索的消息锚点limit - 搜索结果的条数限制InvocationFuture<java.util.List<IMMessage>> queryMessageList(java.lang.String account, SessionTypeEnum sessionType, long offset, int limit)
account - 待查询的聊天对象帐号(个人帐号/群组ID)sessionType - 聊天对象类型(单人聊天/群组)offset - 查询偏移量limit - 查询列表限长InvocationFuture<java.util.List<IMMessage>> queryMessageListEx(IMMessage anchor, QueryDirectionEnum direction, int limit, boolean asc)
anchor - 查询锚点direction - 查询方向limit - 查询结果的条数限制asc - 查询结果的排序规则,如果为true,结果按照时间升序排列,如果为false,按照时间降序排列java.util.List<IMMessage> queryMessageListExBlock(IMMessage anchor, QueryDirectionEnum direction, int limit, boolean asc)
anchor - 查询锚点direction - 查询方向limit - 查询结果的条数限制asc - 查询结果的排序规则,如果为true,结果按照时间升序排列,如果为false,按照时间降序排列InvocationFuture<java.util.List<IMMessage>> queryMessageListExTime(IMMessage anchor, long toTime, QueryDirectionEnum direction, int limit)
anchor - 查询锚点toTime - 查询截止时间,若方向为 QUERY_OLD,toTime 应小于 anchor.getTime()。方向为 QUERY_NEW,toTime 应大于 anchor.getTime() direction - 查询方向limit - 查询结果的条数限制@Deprecated InvocationFuture<java.util.List<IMMessage>> queryMessageListByTypes(java.util.List<MsgTypeEnum> types, IMMessage anchor, long toTime, QueryDirectionEnum direction, int limit, boolean asc)
types - 查询的消息类型集合, 传入null表示所有消息类型,同 queryMessageListExTime(com.netease.nimlib.sdk.msg.model.IMMessage, long, com.netease.nimlib.sdk.msg.model.QueryDirectionEnum, int) 结果anchor - 查询锚点toTime - 查询截止时间,若方向为 QUERY_OLD,toTime 应小于 anchor.getTime()。方向为 QUERY_NEW,toTime 应大于 anchor.getTime(), 填0表示没有时间限制,以 limit限制为主 direction - 查询方向limit - 查询结果的条数限制asc - 查询结果的排序规则,如果为true,结果按照时间升序排列,如果为false,按照时间降序排列InvocationFuture<java.util.List<IMMessage>> queryMessageListByTypesV2(java.util.List<MsgTypeEnum> types, IMMessage anchor, long toTime, QueryDirectionEnum direction, int limit, boolean asc)
types - 查询的消息类型集合, 传入null表示所有消息类型,同 queryMessageListExTime(com.netease.nimlib.sdk.msg.model.IMMessage, long, com.netease.nimlib.sdk.msg.model.QueryDirectionEnum, int) 结果anchor - 查询锚点,锚点消息类型可不在查询的消息类型集合范围内toTime - 查询截止时间,若方向为 QUERY_OLD,toTime 应小于 anchor.getTime()。方向为 QUERY_NEW,toTime 应大于 anchor.getTime(), 填0表示没有时间限制,以 limit限制为主 direction - 查询方向limit - 查询结果的条数限制asc - 查询结果的排序规则,如果为true,结果按照时间升序排列,如果为false,按照时间降序排列InvocationFuture<java.lang.Long> queryRoamMsgHasMoreTime(java.lang.String sessionId, SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型long queryRoamMsgHasMoreTimeBlock(java.lang.String sessionId,
SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型InvocationFuture<java.lang.Long> queryRoamMsgHasMoreTagServerId(java.lang.String sessionId, SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型long queryRoamMsgHasMoreTagServerIdBlock(java.lang.String sessionId,
SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型InvocationFuture<java.util.List<IMMessage>> pullHistoryById(java.util.List<MessageKey> msgKeyList, boolean persist)
msgKeyList - 查询消息的关键字persist - 是否持久化IMMessage queryLastMessage(java.lang.String account, SessionTypeEnum sessionType)
account - 账号sessionType - 会话类型InvocationFuture<java.util.List<IMMessage>> pullMessageHistory(IMMessage anchor, int limit, boolean persist)
anchor - 查询锚点。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可limit - 本次查询的消息条数上限(最多100条)persist - 通过该接口获取的漫游消息记录,是否保存到本地消息数据库。InvocationFuture<java.util.List<IMMessage>> pullMessageHistory(IMMessage anchor, int limit, boolean persist, boolean persistClear)
anchor - 查询锚点。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可limit - 本次查询的消息条数上限(最多100条)persist - 通过该接口获取的漫游消息记录,是否保存到本地消息数据库。persistClear - 是否保存清除记录之前的消息到本地数据库,在persist==true时生效InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryEx(IMMessage anchor, long toTime, int limit, QueryDirectionEnum direction, boolean persist)
anchor - 起始时间点的消息,不能为null。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向,QUERY_OLD按结束时间点逆序查询,逆序排列;QUERY_NEW按起始时间点正序起查,正序排列persist - 通过该接口获取的漫游消息记录,是否保存到本地消息数据库。InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryExType(IMMessage anchor, long toTime, int limit, QueryDirectionEnum direction, MsgTypeEnum[] msgTypes)
以锚点anchor作为起始点(不包含锚点),根据direction参数,往前或往后查询由锚点到toTime之间的最多limit条消息。
查询范围由toTime和limit共同决定,以先到为准。如果到toTime之间消息大于limit条,返回limit条记录,如果小于limit条,返回实际条数。
当已经查询到头时,返回的结果列表的size可能会比limit小,默认不保存到数据库
anchor - 起始时间点的消息,不能为null。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向,QUERY_OLD按结束时间点逆序查询,逆序排列;QUERY_NEW按起始时间点正序起查,正序排列msgTypes - 消息类型,数组。消息类型仅支持 0:文本,1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,100:自定义,其它为非法参数InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryExType(IMMessage anchor, long toTime, int limit, QueryDirectionEnum direction, MsgTypeEnum[] msgTypes, boolean persist)
以锚点anchor作为起始点(不包含锚点),根据direction参数,往前或往后查询由锚点到toTime之间的最多limit条消息。
查询范围由toTime和limit共同决定,以先到为准。如果到toTime之间消息大于limit条,返回limit条记录,如果小于limit条,返回实际条数。
当已经查询到头时,返回的结果列表的size可能会比limit小
anchor - 起始时间点的消息,不能为null。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向,QUERY_OLD按结束时间点逆序查询,逆序排列;QUERY_NEW按起始时间点正序起查,正序排列msgTypes - 消息类型,数组。消息类型仅支持 0:文本,1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,100:自定义,其它为非法参数persist - 通过该接口获取的漫游消息记录,是否保存到本地消息数据库。InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryExType(IMMessage anchor, long toTime, int limit, QueryDirectionEnum direction, MsgTypeEnum[] msgTypes, boolean persist, boolean persistClear)
以锚点anchor作为起始点(不包含锚点),根据direction参数,往前或往后查询由锚点到toTime之间的最多limit条消息。
查询范围由toTime和limit共同决定,以先到为准。如果到toTime之间消息大于limit条,返回limit条记录,如果小于limit条,返回实际条数。
当已经查询到头时,返回的结果列表的size可能会比limit小
anchor - 起始时间点的消息,不能为null。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向,QUERY_OLD按结束时间点逆序查询,逆序排列;QUERY_NEW按起始时间点正序起查,正序排列msgTypes - 消息类型,数组。消息类型仅支持 0:文本,1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,100:自定义,其它为非法参数persist - 通过该接口获取的漫游消息记录,要不要保存到本地消息数据库。persistClear - 是否保存被清除的消息到本地数据库,在persist==true时生效InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryExType(IMMessage anchor, long toTime, int limit, QueryDirectionEnum direction, MsgTypeEnum[] msgTypes, boolean persist, boolean persistClear, IMMessageFilter customFilter)
以锚点anchor作为起始点(不包含锚点),根据direction参数,往前或往后查询由锚点到toTime之间的最多limit条消息。
查询范围由toTime和limit共同决定,以先到为准。如果到toTime之间消息大于limit条,返回limit条记录,如果小于limit条,返回实际条数。
当已经查询到头时,返回的结果列表的size可能会比limit小
anchor - 起始时间点的消息,不能为null。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向,QUERY_OLD按结束时间点逆序查询,逆序排列;QUERY_NEW按起始时间点正序起查,正序排列msgTypes - 消息类型,数组。消息类型仅支持 0:文本,1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,100:自定义,其它为非法参数persist - 通过该接口获取的漫游消息记录,要不要保存到本地消息数据库。persistClear - 是否保存被清除的消息到本地数据库,在persist==true时生效customFilter - 过滤器回调,如果返回true则被忽略,即视为没有拉到这条消息InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryExType(IMMessage anchor, long toTime, int limit, QueryDirectionEnum direction, MsgTypeEnum[] msgTypes, boolean persist, boolean persistClear, IMMessageFilter customFilter, boolean updateUnread)
以锚点anchor作为起始点(不包含锚点),根据direction参数,往前或往后查询由锚点到toTime之间的最多limit条消息。
查询范围由toTime和limit共同决定,以先到为准。如果到toTime之间消息大于limit条,返回limit条记录,如果小于limit条,返回实际条数。
当已经查询到头时,返回的结果列表的size可能会比limit小
anchor - 起始时间点的消息,不能为null。MessageBuilder.createEmptyMessage(String, SessionTypeEnum, long) 创建一个空对象即可toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向,QUERY_OLD按结束时间点逆序查询,逆序排列;QUERY_NEW按起始时间点正序起查,正序排列msgTypes - 消息类型,数组。消息类型仅支持 0:文本,1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,100:自定义,其它为非法参数persist - 通过该接口获取的漫游消息记录,要不要保存到本地消息数据库。persistClear - 是否保存被清除的消息到本地数据库,在persist==true时生效customFilter - 过滤器回调,如果返回true则被忽略,即视为没有拉到这条消息updateUnread - 是否计算未读数InvocationFuture<java.util.List<IMMessage>> pullMessageHistory(MsgFullKeywordSearchConfig config)
config - 配置InvocationFuture<java.util.List<IMMessage>> pullMessageHistoryOrderByTime(MsgTimingFullKeywordSearchConfig config)
config - 检索配置InvocationFuture<GetMessagesDynamicallyResult> getMessagesDynamically(GetMessagesDynamicallyParam param)
param - 参数InvocationFuture<java.util.List<IMMessage>> searchMessageHistory(java.lang.String keyword, java.util.List<java.lang.String> fromAccounts, IMMessage anchor, int limit)
keyword - 文本消息的搜索关键字fromAccounts - 消息说话者帐号列表,如果消息说话在该列表中,那么无需匹配keyword,对应的消息记录会直接加入搜索结果集中。anchor - 搜索的消息锚点limit - 搜索结果的条数限制InvocationFuture<java.util.List<IMMessage>> searchMessageHistory(java.lang.String keyword, java.util.List<java.lang.String> fromAccounts, IMMessage anchor, QueryDirectionEnum direction, int limit)
keyword - 文本消息的搜索关键字fromAccounts - 消息说话者帐号列表,如果消息说话在该列表中,那么无需匹配keyword,对应的消息记录会直接加入搜索结果集中。anchor - 搜索的消息锚点direction - 查询方向limit - 搜索结果的条数限制InvocationFuture<java.util.List<IMMessage>> searchAllMessageHistory(java.lang.String keyword, java.util.List<java.lang.String> fromAccounts, long time, int limit)
keyword - 文本消息的搜索关键字fromAccounts - 消息说话者帐号列表,如果消息说话在该列表中,那么无需匹配keyword,对应的消息记录会直接加入搜索结果集中。time - 查询范围时间点,比time小(从后往前查)limit - 搜索结果的条数限制InvocationFuture<java.util.List<IMMessage>> searchMessage(SessionTypeEnum sessionType, java.lang.String sessionId, MsgSearchOption option)
sessionType - 会话类型sessionId - 聊天对象IDoption - 搜索选项InvocationFuture<java.util.List<IMMessage>> searchAllMessage(MsgSearchOption option)
option - 搜索选项InvocationFuture<java.util.List<MsgIndexRecord>> searchAllSession(java.lang.String query, int limit)
query - 待检索的字符串limit - 最多返回多少条记录java.util.List<MsgIndexRecord> searchAllSessionBlock(java.lang.String query, int limit)
query - 待检索的字符串limit - 最多返回多少条记录InvocationFuture<java.util.List<MsgIndexRecord>> searchSession(java.lang.String query, SessionTypeEnum sessionType, java.lang.String sessionId)
query - 待检索的字符串sessionType - 待检索的会话类型(个人/群组)sessionId - 待检索的会话IDjava.util.List<MsgIndexRecord> searchSessionBlock(java.lang.String query, SessionTypeEnum sessionType, java.lang.String sessionId)
query - 待检索的字符串sessionType - 待检索的会话类型(个人/群组)sessionId - 待检索的会话IDvoid deleteChattingHistory(IMMessage message)
message - 待删除的消息记录void deleteChattingHistory(IMMessage message, boolean ignore)
message - 待删除的消息记录ignore - true: 本地不记录清除操作; false: 本地记录清除操作
从云端拉取消息时,如果本地有删除该消息的操作记录,则该消息不会入库
删除标记会被清除标记覆盖void deleteChattingHistory(java.util.List<IMMessage> msgList, boolean ignore)
msgList - 待删除的消息记录ignore - true: 本地不记录清除操作; false: 本地记录清除操作
从云端拉取消息时,如果本地有删除该消息的操作记录,则该消息不会入库
删除标记会被清除标记覆盖void clearChattingHistory(java.lang.String account,
SessionTypeEnum sessionType)
account - 会话IDsessionType - 聊天类型void clearChattingHistory(java.lang.String account,
SessionTypeEnum sessionType,
boolean ignore)
account - 会话IDsessionType - 聊天类型ignore - true: 本地不记录清除操作; false: 本地记录清除操作,清除记录的作用参见pullMessageHistory(IMMessage, int, boolean, boolean)InvocationFuture<java.lang.Void> clearMsgDatabase(boolean clearRecent)
MsgServiceObserve.observeRecentContactDeleted(Observer, boolean)通知clearRecent - 若为true,将同时清空最近联系人列表数据InvocationFuture<java.lang.Long> deleteMsgSelf(IMMessage msg, java.lang.String ext)
msg - 被单向删除的消息ext - 扩展字段InvocationFuture<java.lang.Long> deleteMsgSelf(java.util.List<IMMessage> msgList, java.lang.String ext)
msgList - 被单向删除的消息ext - 扩展字段boolean everBeenDeleted(IMMessage message)
message - 待查询消息void setChattingAccount(java.lang.String account,
SessionTypeEnum sessionType)
clearUnreadCount(String, SessionTypeEnum),将正在聊天对象的未读数清零。account, - 聊天对象帐号,或者以下两个值:MSG_CHATTING_ACCOUNT_ALLMSG_CHATTING_ACCOUNT_NONEsessionType - 会话类型。如果account不是具体的对象,该参数将被忽略int getTotalUnreadCount()
int getTotalUnreadCount(boolean notify)
notify - true表示只查询排除免打扰之外的消息总未读数,false表示只查询免打扰的消息总未读数int getUnreadCountBySessionType(SessionTypeEnum sessionType)
InvocationFuture<java.util.List<IMMessage>> queryUnreadMessageList(java.lang.String sessionId, SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型java.util.List<IMMessage> queryUnreadMessageListBlock(java.lang.String sessionId, SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型InvocationFuture<java.lang.Void> clearUnreadCount(java.lang.String account, SessionTypeEnum sessionType)
MsgServiceObserve.observeRecentContact(Observer, boolean) 通知account - 聊天对象帐号sessionType - 会话类型InvocationFuture<java.util.List<SessionAckInfo>> clearUnreadCount(java.util.List<<any>> sessionKeyList)
MsgServiceObserve.observeRecentContact(Observer, boolean) 通知sessionKeyList - 聊天对象帐号列表,Pair的第一项为会话ID,第二项为会话类型
会话类型支持传入SessionTypeEnum.P2P和SessionTypeEnum.TeamInvocationFuture<java.util.List<SessionAckInfo>> clearUnreadCount(SessionTypeEnum sessionType)
MsgServiceObserve.observeRecentContact(Observer, boolean) 通知sessionType - 会话类型,支持传入SessionTypeEnum.P2P和SessionTypeEnum.Teamvoid clearAllUnreadCount()
MsgServiceObserve.observeRecentContact(Observer, boolean) 通知InvocationFuture<java.lang.Void> sendMessageReceipt(java.lang.String sessionId, IMMessage message)
sessionId - 会话ID(聊天对象账号)message - P2P已读的消息void updateIMMessageStatus(IMMessage message)
NIMMessage.getStatus() 不为 null 时更新NIMMessage.getAttachStatus() 不为 null 时更新NIMMessage.getAttachment() 不为 null 时更新message - 待更新的消息记录void updateIMMessage(IMMessage message)
message - 待更新的消息记录void registerCustomAttachmentParser(MsgAttachmentParser customParser)
customParser - 附件解析器InvocationFuture<java.lang.Void> sendCustomNotification(CustomNotification notification)
notification - 指令消息InvocationFuture<java.util.List<RecentContact>> queryRecentContacts()
java.util.List<RecentContact> queryRecentContactsBlock()
InvocationFuture<java.util.List<RecentContact>> queryRecentContacts(int limit)
limit - 获取本地会话的数量,最大100,超过100修正到100InvocationFuture<java.util.List<RecentContact>> queryRecentContacts(RecentContact anchor, QueryDirectionEnum direction, int limit)
anchor - 查询最近联系人会话列表的锚点
如果首次查询传null即可;
如果首次查询,当查询方向direction为QUERY_NEW时,则时间按0开始查询;
如果首次查询,当查询方向direction为QUERY_OLD时,则时间按当前系统时间开始查询;
如果想查询下一页数据,传入上一页数据的最后一个RecentContact即可direction - 查询方向
QUERY_OLD查询在时间在anchor之前的数据,逆序排列;
QUERY_NEW查询时间在anchor之后的数据,正序排列limit - 获取本地会话的数量
最大100,超过100修正到100java.util.List<RecentContact> queryRecentContactsBlock(int limit)
limit - 获取本地会话的数量,最大100,超过100修正到100java.util.List<RecentContact> queryRecentContactsBlock(RecentContact anchor, QueryDirectionEnum direction, int limit)
anchor - 查询最近联系人会话列表的锚点
如果首次查询传null即可;
如果首次查询,当查询方向direction为QUERY_NEW时,则时间按0开始查询;
如果首次查询,当查询方向direction为QUERY_OLD时,则时间按当前系统时间开始查询;
如果想查询下一页数据,传入上一页数据的最后一个RecentContact即可direction - 查询方向
QUERY_OLD查询在时间在queryTime之前的数据,逆序排列;
QUERY_NEW查询时间在queryTime之后的数据,正序排列limit - 获取本地会话的数量
最大100,超过100修正到100InvocationFuture<java.util.List<RecentContact>> queryRecentContacts(MsgTypeEnum filterMsgType)
filterMsgType - 过滤消息类型java.util.List<RecentContact> queryRecentContactsBlock(MsgTypeEnum filterMsgType)
filterMsgType - 过滤消息类型InvocationFuture<java.util.List<RecentContact>> queryRecentContacts(java.util.Set<MsgTypeEnum> filterMsgTypeSet)
filterMsgTypeSet - 过滤消息类型java.util.List<RecentContact> queryRecentContactsBlock(java.util.Set<MsgTypeEnum> filterMsgTypeSet)
filterMsgTypeSet - 过滤消息类型void updateRecent(RecentContact recent)
MsgServiceObserve.observeRecentContact(Observer, boolean)的通知, 可使用updateRecentAndNotify(RecentContact)recent - 待更新的最近联系人会话数据void updateRecentAndNotify(RecentContact recent)
MsgServiceObserve.observeRecentContact(Observer, boolean)的通知 。updateRecent(RecentContact) 。recent - 待更新的最近联系人数据。void updateRecentByMessage(IMMessage message, boolean needNotify)
message - 消息。needNotify - 是否需要触发MsgServiceObserve.observeRecentContact(Observer, boolean)的通知void updateRoamMsgHasMoreTag(IMMessage newTag)
newTag - 需要有相对应的会话ID,会话类型,消息的服务ID和消息时间void deleteRecentContact(RecentContact recent)
recent - 待删除的最近联系人会话项void deleteRecentContact2(java.lang.String account,
SessionTypeEnum sessionType)
MsgServiceObserve.observeRecentContactDeleted(Observer, boolean)通知account - sessionType - InvocationFuture<java.lang.Void> deleteRoamingRecentContact(java.lang.String contactId, SessionTypeEnum sessionTypeEnum)
contactId - 最近联系人的ID(好友帐号,群ID等)sessionTypeEnum - 会话类型InvocationFuture<java.lang.Void> deleteRecentContact(java.lang.String account, SessionTypeEnum sessionType, DeleteTypeEnum deleteType, boolean sendAck)
MsgServiceObserve.observeRecentContactDeleted(Observer, boolean)通知account - 会话IDsessionType - 会话类型,只能选SessionTypeEnum.P2P和SessionTypeEnum.Team会删漫游消息deleteType - 删除类型,决定是否删除本地记录和漫游记录,
如果为null,视为DeleteTypeEnum.REMAINsendAck - 如果参数合法,是否向本账号的其他端标记清除未读数void deleteRoamMsgHasMoreTag(java.lang.String sessionId,
SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型AbortableFuture<java.lang.String> transVoiceToText(java.lang.String voiceUrl, java.lang.String path, long duration)
voiceUrl - 语音url。可选项。如果没有,SDK自动做nos上传工作。path - 语音path, 用于获得语音采样率。APP必须保证音频已经下载到本地duration - 语音时长AbortableFuture<java.lang.String> transVoiceToTextAtScene(java.lang.String voiceUrl, java.lang.String path, long duration, java.lang.String sceneKey)
voiceUrl - 语音url。可选项。如果没有,SDK自动做nos上传工作。path - 语音path, 用于获得语音采样率。APP必须保证音频已经下载到本地duration - 语音时长sceneKey - 上传文件时用的nos sceneKey ,默认值:NimNosSceneKeyConstant#NIM_DEFAULT_IM , nos token scene 配置参考NosTokenSceneConfigAbortableFuture<java.lang.String> transVoiceToTextEnableForce(java.lang.String voiceUrl, java.lang.String path, long duration, java.lang.String sceneKey, boolean enableForceUploadFile)
voiceUrl - 语音url。可选项。如果没有,SDK自动做nos上传工作。path - 语音path, 用于获得语音采样率。APP必须保证音频已经下载到本地duration - 语音时长sceneKey - 上传文件时用的nos sceneKey ,默认值:NimNosSceneKeyConstant#NIM_DEFAULT_IM , nos token scene 配置参考NosTokenSceneConfigenableForceUploadFile - 如果服务器存在相同的文件,是否强制重新上传文件 ,默认falseInvocationFuture<java.util.ArrayList<IMMessage>> searchRoamingMsg(java.lang.String otherAccid, long fromTime, long endTime, java.lang.String keyword, int limit, boolean reverse)
otherAccid - 对方的accountfromTime - 起始时间点单位毫秒endTime - 结束时间点单位毫秒keyword - 搜索的关键词limit - 本次查询的消息条数上限(最多100条)reverse - 可选参数,不传默认false,true是表示反向查询(按时间正序起查,正序排列),默认false表示按时间逆序起查,逆序排列void registerIMMessageFilter(IMMessageFilter filter)
filter - 上层实现的通知消息过滤器,决定是否过滤通知消息(不存储到数据库中),传 null 表示注销(取消)通知消息过滤器void registerShouldShowNotificationWhenRevokeFilter(ShowNotificationWhenRevokeFilter filter)
InvocationFuture<java.lang.Void> revokeMessage(IMMessage message)
revokeMessageEx(IMMessage, String, Map)message - 待撤回的消息InvocationFuture<java.lang.Void> revokeMessageEx(IMMessage message, java.lang.String customApnsText, java.util.Map<java.lang.String,java.lang.Object> pushPayload)
NIMClient.toggleRevokeMessageNotification(boolean on)message - 待撤回的消息customApnsText - 第三方透传消息推送文本,不填则不推送pushPayload - 第三方自定义的推送属性,限制json类型,长度2048InvocationFuture<java.lang.Void> revokeMessage(IMMessage message, java.lang.String customApnsText, java.util.Map<java.lang.String,java.lang.Object> pushPayload, boolean shouldNotifyBeCount)
NIMClient.toggleRevokeMessageNotification(boolean on)message - 待撤回的消息customApnsText - 第三方透传消息推送文本,不填则不推送pushPayload - 第三方自定义的推送属性,限制json类型,长度2048shouldNotifyBeCount - 撤回通知是否更新未读数InvocationFuture<java.lang.Void> revokeMessage(IMMessage message, java.lang.String customApnsText, java.util.Map<java.lang.String,java.lang.Object> pushPayload, boolean shouldNotifyBeCount, java.lang.String postscript)
NIMClient.toggleRevokeMessageNotification(boolean on)message - 待撤回的消息customApnsText - 第三方透传消息推送文本,不填则不推送pushPayload - 第三方自定义的推送属性,限制json类型,长度2048shouldNotifyBeCount - 撤回通知是否更新未读数postscript - 附言InvocationFuture<java.lang.Void> revokeMessage(IMMessage message, java.lang.String customApnsText, java.util.Map<java.lang.String,java.lang.Object> pushPayload, boolean shouldNotifyBeCount, java.lang.String postscript, java.lang.String attach)
NIMClient.toggleRevokeMessageNotification(boolean on)message - 待撤回的消息customApnsText - 第三方透传消息推送文本,不填则不推送pushPayload - 第三方自定义的推送属性,限制json类型,长度2048shouldNotifyBeCount - 撤回通知是否更新未读数postscript - 附言attach - 扩展字段InvocationFuture<java.lang.Void> importRecentSessions(java.util.List<<any>> sessions)
sessions - LocalAntiSpamResult checkLocalAntiSpam(java.lang.String content, java.lang.String replacement)
content - 需要检查的文本replacement - 反垃圾词库命中后替换文本RecentContact createEmptyRecentContact(java.lang.String contactId, SessionTypeEnum sessionType, long tag, long time, boolean saveToDB)
contactId - 会话id ,对方帐号或群组id。sessionType - 会话类型tag - 会话tag , eg:置顶标签(UIKit中的实现: RECENT_TAG_STICKY) ,用户参照自己的tag 实现即可, 如不需要,传 0 即可。time - 会话时间 ,单位为ms。saveToDB - 是否需要将会话保存在DB中,注意以下两点:MsgServiceObserve.observeRecentContact(Observer, boolean)通知;
RecentContact createEmptyRecentContact(java.lang.String contactId, SessionTypeEnum sessionType, long tag, long time, boolean saveToDB, boolean withLastMsg)
contactId - 会话id ,对方帐号或群组id。sessionType - 会话类型tag - 会话tag , eg:置顶标签(UIKit中的实现: RECENT_TAG_STICKY) ,用户参照自己的tag 实现即可, 如不需要,传 0 即可。time - 会话时间 ,单位为ms。saveToDB - 是否需要将会话保存在DB中,注意以下两点:MsgServiceObserve.observeRecentContact(Observer, boolean)通知;
withLastMsg - 是否放入最后一条消息的相关信息RecentContact queryRecentContact(java.lang.String contactId, SessionTypeEnum sessionType)
contactId - 会话id ,对方帐号或群组id。sessionType - 会话类型。InvocationFuture<java.lang.Void> cancelUploadAttachment(IMMessage imMessage)
MsgStatusEnum.fail,附件状态是AttachStatusEnum.cancelimMessage - 要取消上传附件的消息AbortableFuture<java.lang.Void> exportAllMessage(IMsgExportProcessor exportProcessor, boolean safeMode)
importAllMessage(IMsgImportProcessor, boolean safeMode)MigrationConstant.EXPORT_ERR_DB_EMPTYMigrationConstant.EXPORT_ERR_LOCAL_FORMATMigrationConstant.EXPORT_ERR_USER_CUSTOM_ZIPMigrationConstant.EXPORT_ERR_USER_CUSTOM_ENCRYPTMigrationConstant.EXPORT_ERR_UPLOAD_FILEMigrationConstant.EXPORT_ERR_EMPTY_AFTER_FILTERexportProcessor - 消息导出处理器,必须设置safeMode - 是否为安全模式,安全模式下处理完成之后会删除相关的文件(包括用户自定义过程的)AbortableFuture<java.lang.Void> importAllMessage(IMsgImportProcessor iMsgImportProcessor, boolean safeMode)
exportAllMessage(IMsgExportProcessor, boolean safeMode)
* 整个过程如下:
step1 : 请求服务器,下载备份文件
step2 : 解密文件(用户自定义过程)
step3 : 解压缩文件(用户自定义过程)
step4 : 解析文件
错误码:
服务端上没有备份记录 : MigrationConstant.IMPORT_ERR_NO_BACKUP
服务端返回了备份记录,可是为空 : MigrationConstant.IMPORT_ERR_RECORD_EMPTY
文件下载失败 : MigrationConstant.IMPORT_ERR_DOWN_FILE
文件解密失败(用户自定义过程) : MigrationConstant.IMPORT_ERR_CUSTOM_DECRYPT
文件解压缩失败(用户自定义过程) : MigrationConstant.IMPORT_ERR_CUSTOM_UNZIP
文件格式错误 : MigrationConstant.IMPORT_ERR_FILE_FORMAT
部分成功: MigrationConstant.IMPORT_ERR_PART_SUCCESS
iMsgImportProcessor - 消息导入处理器,必须设置safeMode - 是否为安全模式,安全模式下处理完成之后会删除相关的文件(包括用户自定义过程的)void clearServerHistory(java.lang.String sessionId,
boolean deleteRoam)
sessionId - 用户帐号deleteRoam - 是否删除漫游消息void clearServerHistory(java.lang.String sessionId,
SessionTypeEnum sessionType)
sessionId - 用户帐号sessionType - 聊天类型void clearServerHistory(java.lang.String sessionId,
SessionTypeEnum sessionType,
boolean deleteRoam)
clearServerHistory(String, boolean)
如果不保留蛮有消息,使用clearServerHistory(String, SessionTypeEnum)sessionId - 用户帐号sessionType - 聊天类型deleteRoam - 是否删除漫游消息void clearServerHistory(java.lang.String sessionId,
SessionTypeEnum sessionType,
boolean sync,
java.lang.String ext)
sessionId - 用户帐号sessionType - 聊天类型sync - 是否同步给其他端ext - 扩展字段void deleteRangeHistory(java.lang.String account,
SessionTypeEnum sessionType,
long startTime,
long endTime)
account - 删除账号sessionType - 删除会话类型startTime - 开始时间endTime - 结束时间InvocationFuture<RecentSessionList> queryMySessionList(long minTimestamp, java.lang.Long maxTimestamp, java.lang.Integer needLastMsg, java.lang.Integer limit, java.lang.Integer hasMore)
minTimestamp - 最小时间戳,作为请求参数时表示增量获取Session列表,传0表示全量获取maxTimestamp - 最大时间戳,翻页时使用needLastMsg - 是否需要lastMsg,0或者1,默认1limit - 结果集limit,最大100,默认100hasMore - 没用queryMySessionList(QueryMySessionOption)InvocationFuture<RecentSessionList> queryMySessionList(QueryMySessionOption option)
option - 配置参数InvocationFuture<RecentSession> queryMySession(java.lang.String sessionId)
sessionId - 分为p2p/team/superTeam,格式分别是:p2p|accid、team|tid、super_team|tidcom.netease.nimlib.biz.constant.ITalkService.SessionTagInvocationFuture<java.lang.Void> updateMySession(java.lang.String sessionId, java.lang.String ext)
sessionId - 分为p2p/team/superTeam,格式分别是:p2p|accid、team|tid、super_team|tidext - 会话的扩展字段,仅自己可见com.netease.nimlib.biz.constant.ITalkService.SessionTagInvocationFuture<java.lang.Void> deleteMySession(java.lang.String[] sessionIdArr)
sessionIdArr - 每一项的格式:分为p2p/team/superTeam,格式分别是:p2p|accid、team|tid、super_team|tidcom.netease.nimlib.biz.constant.ITalkService.SessionTagInvocationFuture<ThreadTalkHistory> queryThreadTalkHistory(IMMessage anchor, long fromTime, long toTime, int limit, QueryDirectionEnum direction, boolean persist)
anchor - 查找锚点,查找对象为此消息所在的thread中的消息fromTime - 起始时间toTime - 终止时间limit - 条数限制direction - 方向persist - 是否持久化int queryReplyCountInThreadTalkBlock(IMMessage msg)
msg - thread中的某一条消息InvocationFuture<java.lang.Void> addQuickComment(IMMessage msg, long replyType, java.lang.String ext)
msg - 回复对象replyType - 回复类型ext - 自定义扩展字段,最大8字符InvocationFuture<java.lang.Long> addQuickComment(IMMessage msg, long replyType, java.lang.String ext, boolean needPush, boolean needBadge, java.lang.String pushTitle, java.lang.String pushContent, java.util.Map<java.lang.String,java.lang.Object> pushPayload)
msg - 回复对象replyType - 回复类型ext - 自定义扩展字段,最大8字符needPush - 是否需要推送needBadge - 是否需要角标pushTitle - 推送标题pushContent - 推送内容pushPayload - 第三方自定义的推送属性,限制json类型InvocationFuture<java.lang.Void> removeQuickComment(IMMessage msg, long replyType, java.lang.String ext)
msg - 回复对象replyType - 回复类型ext - 自定义扩展字段,最大8字符InvocationFuture<java.lang.Long> removeQuickComment(IMMessage msg, long replyType, java.lang.String ext, boolean needPush, boolean needBadge, java.lang.String pushTitle, java.lang.String pushContent, java.util.Map<java.lang.String,java.lang.Object> pushPayload)
msg - 回复对象replyType - 回复类型ext - 自定义扩展字段,最大8字符needPush - 是否需要推送needBadge - 是否需要角标pushTitle - 推送标题pushContent - 推送内容pushPayload - 第三方自定义的推送属性,限制json类型InvocationFuture<java.util.List<QuickCommentOptionWrapper>> queryQuickComment(java.util.List<IMMessage> msgList)
msgList - 每个元素是被查询快捷评论的消息,数量不超过20InvocationFuture<CollectInfo> addCollect(int type, java.lang.String date, java.lang.String ext, java.lang.String uniqueId)
type - 收藏类型date - 收藏内容,最大20kext - 扩展字段,最大1kuniqueId - 去重唯一IDInvocationFuture<java.lang.Integer> removeCollect(java.util.List<<any>> collectInfo)
collectInfo - 要移除的收藏的关键信息组成的列表,每一项为一个Pair,其中第一项为收藏的ID,第二项为收藏的创建时间CollectInfoInvocationFuture<CollectInfo> updateCollect(CollectInfo info, java.lang.String ext)
info - 要更新的收藏ext - 更新后的扩展字段InvocationFuture<CollectInfo> updateCollect(long infoId, long createTime, java.lang.String ext)
infoId - 要更新的收藏的IDcreateTime - 要更新的收藏的创建时间ext - 更新后的扩展字段InvocationFuture<CollectInfoPage> queryCollect(int limit)
limit - 本次查询的消息条数上限(最多100条)InvocationFuture<CollectInfoPage> queryCollect(CollectInfo anchor, long toTime, int limit, QueryDirectionEnum direction)
anchor - 结束查询的最后一条收藏(不包含在查询结果中)toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向InvocationFuture<CollectInfoPage> queryCollect(CollectInfo anchor, long toTime, int limit, QueryDirectionEnum direction, int type, boolean persist)
anchor - 结束查询的最后一条收藏(不包含在查询结果中)toTime - 结束时间点单位毫秒limit - 本次查询的消息条数上限(最多100条)direction - 查询方向type - 收藏类型persist - 是否持久化InvocationFuture<java.lang.Long> addMsgPin(IMMessage msg, java.lang.String ext)
msg - 被PIN的消息ext - 扩展字段InvocationFuture<java.lang.Long> updateMsgPin(IMMessage msg, java.lang.String ext)
msg - 被PIN的消息ext - 扩展字段InvocationFuture<java.lang.Long> removeMsgPin(IMMessage msg, java.lang.String ext)
msg - 被PIN的消息ext - 扩展字段InvocationFuture<MsgPinSyncResponseOptionWrapper> syncMsgPin(SessionTypeEnum sessionType, java.lang.String sessionId, long timestamp)
sessionType - 会话类型sessionId - 会话IDtimestamp - 时间戳,同步时间戳以后的PINjava.util.List<MsgPinDbOption> queryMsgPinBlock(java.lang.String sessionId, SessionTypeEnum sessionType)
sessionId - 会话IDsessionType - 会话类型InvocationFuture<StickTopSessionInfo> addStickTopSession(java.lang.String sessionId, SessionTypeEnum sessionType, java.lang.String ext)
sessionId - 会话IDsessionType - 会话类型ext - 扩展字段,最大512字符InvocationFuture<java.lang.Void> removeStickTopSession(java.lang.String sessionId, SessionTypeEnum sessionType, java.lang.String ext)
sessionId - 会话IDsessionType - 会话类型ext - 扩展字段,最大512字符InvocationFuture<StickTopSessionInfo> updateStickTopSession(java.lang.String sessionId, SessionTypeEnum sessionType, java.lang.String ext)
sessionId - 会话IDsessionType - 会话类型ext - 扩展字段,最大512字符java.util.List<StickTopSessionInfo> queryStickTopSessionBlock()
boolean isStickTopSession(java.lang.String sessionId,
SessionTypeEnum sessionType)
sessionId - 会话ID,如果为""或null,返回falsesessionType - 会话类型,如果为null,返回falsevoid migrateMessages(java.lang.String from,
java.lang.String to,
boolean changeFrom)
from - 源聊天记录账号to - 目标聊天记录账号changeFrom - 是否要修改源聊天记录中 IMMessage 的 fromAccount,如果为true,fromAccount由from改为to