fix(app): apply streamer mode to member nicknames and stop guild scope leaking into global surfaces (#1697)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-17 14:58:56 +02:00
1 parent 3fa766c39c
commit 3ff7189566
32 files changed
+82 -61

No files matched your search

@@ -262,7 +262,7 @@ interface VoiceParticipantPopoutRowProps {
function VoiceParticipantPopoutRow({entry, guildId, channelId}: VoiceParticipantPopoutRowProps) {
const {i18n} = useLingui();
const displayName = NicknameUtils.getNickname(entry.user, guildId ?? undefined, channelId ?? undefined);
const displayName = NicknameUtils.getNickname(entry.user, guildId ?? null, channelId ?? undefined);
const participantName = displayName || i18n._(UNKNOWN_USER_DESCRIPTOR);
const {scheduleProfilePreload, cancelProfilePreload} = useUserProfileHoverPreload({
userId: entry.user.id,
@@ -405,7 +405,7 @@ export const VoiceParticipantSpeakingAvatarStack: React.FC<VoiceParticipantSpeak
event.stopPropagation();
const entry = sortedEntries[index];
if (!entry) return;
const displayName = NicknameUtils.getNickname(user, guildId ?? undefined, channelId ?? undefined);
const displayName = NicknameUtils.getNickname(user, guildId ?? null, channelId ?? undefined);
const participantName = displayName || i18n._(UNKNOWN_USER_DESCRIPTOR);
ContextMenuCommands.openFromEvent(event, ({onClose}) => (
<VoiceParticipantContextMenu
@@ -554,7 +554,7 @@ export const VoiceParticipantWrappedAvatarList: React.FC<VoiceParticipantWrapped
(event: React.MouseEvent<HTMLElement>, entry: VoiceParticipantAvatarEntry) => {
event.preventDefault();
event.stopPropagation();
const displayName = NicknameUtils.getNickname(entry.user, guildId ?? undefined, channelId ?? undefined);
const displayName = NicknameUtils.getNickname(entry.user, guildId ?? null, channelId ?? undefined);
const participantName = displayName || i18n._(UNKNOWN_USER_DESCRIPTOR);
ContextMenuCommands.openFromEvent(event, ({onClose}) => (
<VoiceParticipantContextMenu
@@ -44,7 +44,7 @@ function getUserDisplayName(userId: string, guildId?: string | null, channelId?:
if (!userId) return '';
const user = Users.getUser(userId);
if (!user) return '';
return NicknameUtils.getNickname(user, guildId ?? undefined, channelId ?? undefined) || '';
return NicknameUtils.getNickname(user, guildId ?? null, channelId ?? undefined) || '';
}
function buildSnapshotFallbackDisplayName(userId: string, participantKey: string): string {
@@ -169,7 +169,7 @@ const PiPOverlayInnerBase = observer(function PiPOverlayInnerBase({content, room
const {viewerUsers} = useStreamSpectators(isScreenShare ? streamKey : '', content.userId);
const displayName = useMemo(() => {
if (!participantUser) return '';
return NicknameUtils.getNickname(participantUser, content.guildId ?? undefined, content.channelId);
return NicknameUtils.getNickname(participantUser, content.guildId ?? null, content.channelId);
}, [participantUser, content.guildId, content.channelId]);
const disconnectLabel = i18n._(VOICE_DISCONNECT_DESCRIPTOR);
const channelName = channel?.name ?? '';
@@ -85,7 +85,7 @@ function formatUserMention(userId: string, guildId: string | null, i18n: I18n):
if (!user) {
return i18n._(UNKNOWN_USER_DESCRIPTOR);
}
return NicknameUtils.getNickname(user, guildId ?? undefined);
return NicknameUtils.getNickname(user, guildId ?? null);
}
function formatRoleMention(roleId: string, guildId: string | null, i18n: I18n): string {
@@ -438,7 +438,7 @@ function handleIncomingTtsMessage(message: Message): void {
if (!author) {
return;
}
const authorName = NicknameUtils.getNickname(author, channel.guildId ?? undefined);
const authorName = NicknameUtils.getNickname(author, channel.guildId ?? null);
if (!message.content.trim()) {
const description = describeNonTextContent(message, localI18n);
if (!description) {
@@ -457,7 +457,7 @@ function handleIncomingTtsMessage(message: Message): void {
if (ref.message) {
const replyAuthor = Users.getUser(ref.message.author.id);
if (replyAuthor) {
replyAuthorName = NicknameUtils.getNickname(replyAuthor, channel.guildId ?? undefined);
replyAuthorName = NicknameUtils.getNickname(replyAuthor, channel.guildId ?? null);
}
}
}