Revert external content share back to kind 1 with i tag
Kind 16 requires an e tag pointing to a Nostr event ID, which external content doesn't have. Kind 1 with an i tag is the correct approach.
This commit is contained in:
@@ -89,7 +89,7 @@ export function useExternalRepostStatus(content: ExternalContent | null | undefi
|
||||
|
||||
const events = await nostr.query(
|
||||
[{
|
||||
kinds: [16],
|
||||
kinds: [1],
|
||||
authors: [user.pubkey],
|
||||
'#i': [identifier],
|
||||
limit: 1,
|
||||
|
||||
@@ -117,20 +117,19 @@ function ExternalActionBar({ content }: { content: ExternalContent }) {
|
||||
);
|
||||
}, [user, content, identifier, publishEvent, queryClient, toast]);
|
||||
|
||||
// Publish kind 16 generic repost with i tag
|
||||
// Publish kind 1 note sharing the external content via i tag
|
||||
const handleShare = useCallback(() => {
|
||||
if (!user) return;
|
||||
queryClient.setQueryData(['external-user-repost', identifier], 'optimistic');
|
||||
|
||||
publishEvent(
|
||||
{
|
||||
kind: 16,
|
||||
content: '',
|
||||
kind: 1,
|
||||
content: identifier,
|
||||
created_at: Math.floor(Date.now() / 1000),
|
||||
tags: [
|
||||
['i', identifier],
|
||||
['k', getExternalKTag(content)],
|
||||
['alt', `Repost of ${identifier}`],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user