修复群聊会话类型和优化智能体头像URL
- 修复 `GroupChatListViewModel.kt` 中群聊会话类型的过滤条件,将 `conversationType` 的值从 `2` 修正为 `3`。 - 简化 `AgentChatListViewModel.kt` 中智能体头像(avatar)URL的构建逻辑。
This commit is contained in:
@@ -53,7 +53,7 @@ data class AgentConversation(
|
||||
nickname = conversation.showName ?: "",
|
||||
lastMessage = displayText, // 使用解析后的显示文本
|
||||
lastMessageTime = lastMessage.time.formatChatTime(context),
|
||||
avatar = "${ApiClient.BASE_API_URL+"/"}${conversation.faceURL}"+"?token="+"${AppStore.token}".replace("storage/avatars/", "/avatar/"),
|
||||
avatar = "${ApiClient.BASE_SERVER}${conversation.faceURL}",
|
||||
unreadCount = conversation.unreadCount,
|
||||
trtcUserId = conversation.userID ?: "",
|
||||
displayText = displayText,
|
||||
|
||||
@@ -136,8 +136,8 @@ object GroupChatListViewModel : ViewModel() {
|
||||
|
||||
private suspend fun loadGroupChatList(context: Context) {
|
||||
// 检查 OpenIM 是否已登录
|
||||
if (!com.aiosman.ravenow.AppState.enableChat) {
|
||||
android.util.Log.w("GroupChatListViewModel", "OpenIM 未登录,跳过加载群聊列表")
|
||||
if (!AppState.enableChat) {
|
||||
Log.w("GroupChatListViewModel", "OpenIM 未登录,跳过加载群聊列表")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@ object GroupChatListViewModel : ViewModel() {
|
||||
|
||||
// 过滤出群聊会话(群聊类型)
|
||||
val filteredConversations = result.filter { conversation ->
|
||||
// 2 表示群聊类型
|
||||
conversation.conversationType == 2
|
||||
// 3 表示群聊类型
|
||||
conversation.conversationType == 3
|
||||
}
|
||||
|
||||
groupChatList = filteredConversations.map { conversation ->
|
||||
|
||||
Reference in New Issue
Block a user