diff --git a/desktop/src/features/channels/ui/ChannelScreen.tsx b/desktop/src/features/channels/ui/ChannelScreen.tsx index ac2c8b891a..0c82997b15 100644 --- a/desktop/src/features/channels/ui/ChannelScreen.tsx +++ b/desktop/src/features/channels/ui/ChannelScreen.tsx @@ -202,17 +202,17 @@ export function ChannelScreen({ const pLookup = new Map(); const rLookup = new Map(); - // Populate from profile data (works for all bots, including other users' bots). + const botPubkeys = new Set( + (channelMembers ?? []) + .filter((m) => m.role === "bot") + .map((m) => m.pubkey.toLowerCase()), + ); const profiles = messageProfilesQuery.data?.profiles; if (profiles) { for (const [pubkey, profile] of Object.entries(profiles)) { - if ( - profile.respondTo === "anyone" || - profile.respondTo === "allowlist" || - profile.respondTo === "owner-only" - ) { - rLookup.set(pubkey.toLowerCase(), profile.respondTo); - } + const key = pubkey.toLowerCase(); + const rt = profile.respondTo as RespondToMode | null; + if (botPubkeys.has(key) && rt) rLookup.set(key, rt); } } @@ -225,6 +225,7 @@ export function ChannelScreen({ } return { personaLookup: pLookup, respondToLookup: rLookup }; }, [ + channelMembers, managedAgentsQuery.data, messageProfilesQuery.data?.profiles, personasQuery.data, diff --git a/desktop/src/features/messages/ui/MessageRow.tsx b/desktop/src/features/messages/ui/MessageRow.tsx index 9af00ee0d4..f423651146 100644 --- a/desktop/src/features/messages/ui/MessageRow.tsx +++ b/desktop/src/features/messages/ui/MessageRow.tsx @@ -391,6 +391,7 @@ export const MessageRow = React.memo( prev.message.tags === next.message.tags && prev.message.role === next.message.role && prev.message.personaDisplayName === next.message.personaDisplayName && + prev.message.respondTo === next.message.respondTo && prev.highlighted === next.highlighted && prev.activeReplyTargetId === next.activeReplyTargetId && prev.layoutVariant === next.layoutVariant &&