Files
buzz/desktop/src/features/channels/useMessageEventProfilePubkeys.ts
Jordan Mecom c540ec9678 [codex] Prevent actor-tag UI impersonation (#1931)
Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
2026-07-16 15:07:26 -04:00

26 lines
765 B
TypeScript

import * as React from "react";
import {
collectMessageAuthorPubkeys,
collectMessageMentionPubkeys,
collectReactionActorPubkeys,
} from "@/features/messages/lib/formatTimelineMessages";
import type { RelayEvent } from "@/shared/api/types";
export function useMessageEventProfilePubkeys(
messages: RelayEvent[],
threadReplies: RelayEvent[],
relaySelfPubkey: string | null | undefined,
) {
return React.useMemo(() => {
const events = [...messages, ...threadReplies];
return [
...new Set([
...collectMessageAuthorPubkeys(events, relaySelfPubkey),
...collectMessageMentionPubkeys(events),
...collectReactionActorPubkeys(events, relaySelfPubkey),
]),
];
}, [messages, relaySelfPubkey, threadReplies]);
}