mirror of
https://github.com/block/buzz.git
synced 2026-11-12 12:22:06 +00:00
Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
26 lines
765 B
TypeScript
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]);
|
|
}
|