diff --git a/src/components/Note/Highlight.tsx b/src/components/Note/Highlight.tsx
index 44930ed..6b9ef30 100644
--- a/src/components/Note/Highlight.tsx
+++ b/src/components/Note/Highlight.tsx
@@ -1,6 +1,5 @@
import { useFetchEvent, useTranslatedEvent } from '@/hooks'
import { createFakeEvent } from '@/lib/event'
-import { getHighlightSourceTag } from '@/lib/event-metadata'
import { toNote } from '@/lib/link'
import { isValidPubkey } from '@/lib/pubkey'
import { generateBech32IdFromATag, generateBech32IdFromETag } from '@/lib/tag'
@@ -38,7 +37,36 @@ export default function Highlight({ event, className }: { event: Event; classNam
function HighlightSource({ event }: { event: Event }) {
const { t } = useTranslation()
const { push } = useSecondaryPage()
- const sourceTag = useMemo(() => getHighlightSourceTag(event), [event])
+ const sourceTag = useMemo(() => {
+ let sourceTag: string[] | undefined
+ for (const tag of event.tags) {
+ // Highest priority: 'source' tag
+ if (tag[2] === 'source') {
+ sourceTag = tag
+ break
+ }
+
+ // Give 'e' tags highest priority
+ if (tag[0] === 'e') {
+ sourceTag = tag
+ continue
+ }
+
+ // Give 'a' tags second priority over 'e' tags
+ if (tag[0] === 'a' && (!sourceTag || sourceTag[0] !== 'e')) {
+ sourceTag = tag
+ continue
+ }
+
+ // Give 'r' tags lowest priority
+ if (tag[0] === 'r' && (!sourceTag || sourceTag[0] === 'r')) {
+ sourceTag = tag
+ continue
+ }
+ }
+
+ return sourceTag
+ }, [event])
const { event: referenceEvent } = useFetchEvent(
sourceTag
? sourceTag[0] === 'e'
diff --git a/src/components/ReplyNote/Highlight.tsx b/src/components/ReplyNote/Highlight.tsx
deleted file mode 100644
index 8c4304c..0000000
--- a/src/components/ReplyNote/Highlight.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { useTranslatedEvent } from '@/hooks'
-import { createFakeEvent } from '@/lib/event'
-import { cn } from '@/lib/utils'
-import { Event } from 'nostr-tools'
-import { useMemo } from 'react'
-import Content from '../Content'
-
-export default function Highlight({ event, className }: { event: Event; className?: string }) {
- const translatedEvent = useTranslatedEvent(event.id)
- const comment = useMemo(
- () => (translatedEvent?.tags ?? event.tags).find((tag) => tag[0] === 'comment')?.[1],
- [event, translatedEvent]
- )
-
- return (
-
- {comment &&
}
-
-
-
- {translatedEvent?.content ?? event.content}
-
-
-
- )
-}
diff --git a/src/components/ReplyNote/index.tsx b/src/components/ReplyNote/index.tsx
index 0e94145..c0b82d1 100644
--- a/src/components/ReplyNote/index.tsx
+++ b/src/components/ReplyNote/index.tsx
@@ -6,7 +6,7 @@ import { toNote } from '@/lib/link'
import { useContentPolicy } from '@/providers/ContentPolicyProvider'
import { useMuteList } from '@/providers/MuteListProvider'
import { useScreenSize } from '@/providers/ScreenSizeProvider'
-import { Event, kinds } from 'nostr-tools'
+import { Event } from 'nostr-tools'
import { useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import ClientTag from '../ClientTag'
@@ -15,12 +15,11 @@ import Content from '../Content'
import { FormattedTimestamp } from '../FormattedTimestamp'
import Nip05 from '../Nip05'
import NoteOptions from '../NoteOptions'
-import ParentNotePreview from '../ParentNotePreview'
import StuffStats from '../StuffStats'
+import ParentNotePreview from '../ParentNotePreview'
import TranslateButton from '../TranslateButton'
import UserAvatar from '../UserAvatar'
import Username from '../Username'
-import Highlight from './Highlight'
export default function ReplyNote({
event,
@@ -52,13 +51,6 @@ export default function ReplyNote({
return true
}, [showMuted, mutePubkeySet, event, hideContentMentioningMutedUsers])
- let content: React.ReactNode
- if (event.kind === kinds.Highlights) {
- content =
- } else {
- content =
- }
-
return (
)}
{show ? (
- content
+
) : (