From 2ae2ece968ee2d9eedcd7a6ea5f67bf46138ef07 Mon Sep 17 00:00:00 2001 From: Salastil Date: Fri, 28 Aug 2026 17:51:51 -0400 Subject: [PATCH] Show the call view for a guild's voice channel too It keyed on the session's bufferId, which a guild voice channel does not have - it is its own channel with no text buffer behind it, so the panel could only ever have appeared for one-to-one calls. Confirmed against a live join: the session came back with bufferId null and a guildId, and nothing mounted. It now also matches on the guild, so the call shows on whatever channel of that server is open. That is where Discord keeps it, and the only place it could go without inventing a buffer for a channel that has none. --- src/renderer/src/components/CallView.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/CallView.tsx b/src/renderer/src/components/CallView.tsx index d266c58..86cb5f2 100644 --- a/src/renderer/src/components/CallView.tsx +++ b/src/renderer/src/components/CallView.tsx @@ -34,7 +34,22 @@ export function CallView({ bufferId }: { bufferId: string }): JSX.Element | null const [speaking, setSpeaking] = useState>({}) const [folded, setFolded] = useState(false) - const session = sessions.find((s) => s.bufferId === bufferId) + /** + * The call this conversation should be showing. + * + * Two ways to match, because the two kinds of call are anchored + * differently. A one-to-one call belongs to the DM it is in, and shows on + * that conversation only. A guild's voice channel belongs to no text + * conversation at all - it is its own channel, with no buffer - so it shows + * on whatever channel of that guild is open, which is where Discord keeps + * it too and the only place it could go without inventing a buffer for it. + */ + const buffer = buffers.find((b) => b.id === bufferId) + const session = sessions.find( + (s) => + s.bufferId === bufferId || + (!!s.guildId && !!buffer?.groupId && buffer.groupId === `${s.accountId}|guild:${s.guildId}`) + ) const accountId = session?.accountId const channelId = session?.channelId @@ -91,7 +106,6 @@ export function CallView({ bufferId }: { bufferId: string }): JSX.Element | null if (!session) return null - const buffer = buffers.find((b) => b.id === bufferId) const talking = (m: VoiceMember): boolean => m.isSelf ? speaking.self !== undefined : (speaking[m.userId] ?? 0) > 0