Reapply "fix(federation): normalize federated username display across UI"
This reverts commit 5c3185b69f.
This commit is contained in:
@@ -6,7 +6,7 @@ import { useAuthStore } from '../../stores/authStore';
|
||||
import { useSocialStore } from '../../stores/socialStore';
|
||||
import { Avatar } from '../ui/Avatar';
|
||||
import { hasPermissionBit, PermissionBits } from '../../utils/permissions';
|
||||
import { isSelf } from '../../utils/identity';
|
||||
import { isSelf, parseFederatedUsername } from '../../utils/identity';
|
||||
import { useDelayedLoading } from '../../hooks/useDelayedLoading';
|
||||
import type { MessageWithUser } from '@backspace/shared';
|
||||
|
||||
@@ -374,8 +374,9 @@ function WelcomeHeader({ channelId }: { channelId: string }) {
|
||||
if (isDm) {
|
||||
const dm = dmChannels.find(d => d.id === channelId);
|
||||
const otherUser = dm?.members.find(m => !isSelf(m, authUser));
|
||||
const displayName = otherUser?.displayName ?? otherUser?.username ?? 'Unknown';
|
||||
const username = otherUser?.username ?? 'unknown';
|
||||
const { baseName } = parseFederatedUsername(otherUser?.username ?? 'unknown');
|
||||
const displayName = otherUser?.displayName ?? baseName;
|
||||
const username = baseName;
|
||||
const isFriend = otherUser ? friends.some(f => f.id === otherUser.id) : false;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user