imConversationDisplay
IM 会话列表展示名与头像成员选取(无副作用)。
函数签名
typescript
type ImUserProfileForDisplay = {
displayName: string
avatarUrl?: string
}
function fallbackImPeerDisplayLabel(userId: string): string
function pickConversationDisplayMemberIds(
members: string[],
viewerId: string,
): string[]
function buildConversationDisplayName(
orderedUserIds: string[],
profileById: Map<string, ImUserProfileForDisplay>,
): string使用场景
- 会话列表标题拼接
- 合成群头像时选取前 N 名成员