mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-03 16:09:52 +02:00
show article mentions in notifications
This commit is contained in:
@@ -27,10 +27,10 @@ export function getEventUID(event: NostrEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isReply(event: NostrEvent | DraftNostrEvent) {
|
export function isReply(event: NostrEvent | DraftNostrEvent) {
|
||||||
return event.kind === 1 && !!getReferences(event).replyId;
|
return !!getReferences(event).replyId;
|
||||||
}
|
}
|
||||||
export function isMentionedInContent(event: NostrEvent | DraftNostrEvent, pubkey: string) {
|
export function isMentionedInContent(event: NostrEvent | DraftNostrEvent, pubkey: string) {
|
||||||
return event.kind === 1 && filterTagsByContentRefs(event.content, event.tags).some((t) => t[1] === pubkey);
|
return filterTagsByContentRefs(event.content, event.tags).some((t) => t[1] === pubkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isRepost(event: NostrEvent | DraftNostrEvent) {
|
export function isRepost(event: NostrEvent | DraftNostrEvent) {
|
||||||
|
@@ -41,7 +41,7 @@ export default function NotificationTimelineProvider({ children }: PropsWithChil
|
|||||||
account?.pubkey
|
account?.pubkey
|
||||||
? {
|
? {
|
||||||
"#p": [account.pubkey],
|
"#p": [account.pubkey],
|
||||||
kinds: [Kind.Text, Kind.Repost, Kind.Reaction, Kind.Zap, TORRENT_COMMENT_KIND],
|
kinds: [Kind.Text, Kind.Repost, Kind.Reaction, Kind.Zap, TORRENT_COMMENT_KIND, Kind.Article],
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
{ eventFilter },
|
{ eventFilter },
|
||||||
|
@@ -97,7 +97,7 @@ export default function CommunityHomePage({ community }: { community: NostrEvent
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Flex gap="4" alignItems="flex-start" overflow="hidden">
|
<Flex gap="4" alignItems="flex-start" overflow="hidden">
|
||||||
<Flex direction="column" gap="4" flex={1} overflow="hidden">
|
<Flex direction="column" gap="4" flex={1} overflow="hidden" minH="full">
|
||||||
<ButtonGroup size="sm">
|
<ButtonGroup size="sm">
|
||||||
<Button
|
<Button
|
||||||
colorScheme="primary"
|
colorScheme="primary"
|
||||||
|
@@ -181,6 +181,7 @@ const NotificationItem = ({ event }: { event: NostrEvent }) => {
|
|||||||
switch (event.kind) {
|
switch (event.kind) {
|
||||||
case Kind.Text:
|
case Kind.Text:
|
||||||
case TORRENT_COMMENT_KIND:
|
case TORRENT_COMMENT_KIND:
|
||||||
|
case Kind.Article:
|
||||||
content = <NoteNotification event={event} ref={ref} />;
|
content = <NoteNotification event={event} ref={ref} />;
|
||||||
break;
|
break;
|
||||||
case Kind.Reaction:
|
case Kind.Reaction:
|
||||||
|
Reference in New Issue
Block a user