【m】消息接收发送

This commit is contained in:
2026-04-11 00:03:30 +08:00
parent e9b7070219
commit 59d4105ed3
29 changed files with 258 additions and 834 deletions

View File

@@ -234,10 +234,20 @@ class UIRenderer {
}
if (this.elements.remoteStatus) {
this.elements.remoteStatus.textContent = this.getStatusText(remoteUser.status);
// 显示与黄框中一致的状态
if (!remoteUser.mediaState.audio) {
this.elements.remoteStatus.textContent = '静音中';
} else if (!remoteUser.mediaState.video) {
this.elements.remoteStatus.textContent = '视频关闭';
} else {
this.elements.remoteStatus.textContent = this.getStatusText(remoteUser.status);
}
}
}
// 同步更新侧边栏用户列表
this.renderUserList(this.stateManager.getState().session.localUser, remoteUser);
// 当远程视频关闭时显示占位符
if (this.elements.remoteVideoPlaceholder) {
const shouldShowPlaceholder = !remoteUser.mediaState.video;
@@ -479,14 +489,15 @@ class UIRenderer {
// 计算通话成员总数
let userCount = 1; // 至少有本地用户
if (remoteUser.status === 'online' || remoteUser.status === 'connecting') {
userCount++; // 只有当远程用户在线或连接中时,增加计数
}
if (remoteUser.status !== 'offline') {
userCount++; // 如果远程用户在线,增加计数
}
// 更新通话成员总数显示
if (this.elements.userCountDisplay) {
this.elements.userCountDisplay.textContent = `通话成员 (${userCount})`;
}
const userCountElement = this.elements.userList.closest('div').querySelector('h3.text-sm.font-medium.text-gray-400');
if (userCountElement) {
userCountElement.textContent = `通话成员 (${userCount})`;
}
// 渲染本地用户
const localUserElement = this.elements.userList.querySelector('[data-user-id="local"]');