mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 14:04:21 +01:00
feat: k tag in reaction and repost
This commit is contained in:
@@ -93,6 +93,7 @@ const ReactionAction = (props: { event: NostrEvent }) => {
|
|||||||
pubkey: pubkeyNonNull,
|
pubkey: pubkeyNonNull,
|
||||||
reactionTypes: reactionTypes ?? { type: 'LikeDislike', content: '+' },
|
reactionTypes: reactionTypes ?? { type: 'LikeDislike', content: '+' },
|
||||||
eventId: eventIdNonNull,
|
eventId: eventIdNonNull,
|
||||||
|
kind: props.event.kind,
|
||||||
notifyPubkey: props.event.pubkey,
|
notifyPubkey: props.event.pubkey,
|
||||||
});
|
});
|
||||||
setReacted(true);
|
setReacted(true);
|
||||||
@@ -185,6 +186,7 @@ const RepostAction = (props: { event: NostrEvent }) => {
|
|||||||
relayUrls: config().relayUrls,
|
relayUrls: config().relayUrls,
|
||||||
pubkey: pubkeyNonNull,
|
pubkey: pubkeyNonNull,
|
||||||
eventId: eventIdNonNull,
|
eventId: eventIdNonNull,
|
||||||
|
kind: props.event.kind,
|
||||||
notifyPubkey: props.event.pubkey,
|
notifyPubkey: props.event.pubkey,
|
||||||
});
|
});
|
||||||
setReposted(true);
|
setReposted(true);
|
||||||
@@ -269,6 +271,7 @@ const EmojiReactions: Component<{ event: NostrEvent }> = (props) => {
|
|||||||
pubkey: pubkeyNonNull,
|
pubkey: pubkeyNonNull,
|
||||||
reactionTypes: reactionTypes ?? { type: 'LikeDislike', content: '+' },
|
reactionTypes: reactionTypes ?? { type: 'LikeDislike', content: '+' },
|
||||||
eventId: eventIdNonNull,
|
eventId: eventIdNonNull,
|
||||||
|
kind: props.event.kind,
|
||||||
notifyPubkey: props.event.pubkey,
|
notifyPubkey: props.event.pubkey,
|
||||||
});
|
});
|
||||||
setReacted(true);
|
setReacted(true);
|
||||||
|
|||||||
@@ -123,18 +123,21 @@ const useCommands = () => {
|
|||||||
relayUrls,
|
relayUrls,
|
||||||
pubkey,
|
pubkey,
|
||||||
eventId,
|
eventId,
|
||||||
|
kind,
|
||||||
reactionTypes,
|
reactionTypes,
|
||||||
notifyPubkey,
|
notifyPubkey,
|
||||||
}: {
|
}: {
|
||||||
relayUrls: string[];
|
relayUrls: string[];
|
||||||
pubkey: string;
|
pubkey: string;
|
||||||
eventId: string;
|
eventId: string;
|
||||||
|
kind: number;
|
||||||
reactionTypes: ReactionTypes;
|
reactionTypes: ReactionTypes;
|
||||||
notifyPubkey: string;
|
notifyPubkey: string;
|
||||||
}): Promise<Promise<void>[]> => {
|
}): Promise<Promise<void>[]> => {
|
||||||
const tags = [
|
const tags = [
|
||||||
['e', eventId, ''],
|
['e', eventId, ''],
|
||||||
['p', notifyPubkey],
|
['p', notifyPubkey],
|
||||||
|
['k', kind.toString()],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (reactionTypes.type === 'CustomEmoji') {
|
if (reactionTypes.type === 'CustomEmoji') {
|
||||||
@@ -156,20 +159,23 @@ const useCommands = () => {
|
|||||||
relayUrls,
|
relayUrls,
|
||||||
pubkey,
|
pubkey,
|
||||||
eventId,
|
eventId,
|
||||||
|
kind,
|
||||||
notifyPubkey,
|
notifyPubkey,
|
||||||
}: {
|
}: {
|
||||||
relayUrls: string[];
|
relayUrls: string[];
|
||||||
pubkey: string;
|
pubkey: string;
|
||||||
eventId: string;
|
eventId: string;
|
||||||
|
kind: number;
|
||||||
notifyPubkey: string;
|
notifyPubkey: string;
|
||||||
}): Promise<Promise<void>[]> => {
|
}): Promise<Promise<void>[]> => {
|
||||||
const preSignedEvent: UnsignedEvent = {
|
const preSignedEvent: UnsignedEvent = {
|
||||||
kind: 6 as Kind,
|
kind: kind === 1 ? Kind.Repost : 16 /* generic repost */,
|
||||||
pubkey,
|
pubkey,
|
||||||
created_at: epoch(),
|
created_at: epoch(),
|
||||||
tags: [
|
tags: [
|
||||||
['e', eventId, ''],
|
['e', eventId, ''],
|
||||||
['p', notifyPubkey],
|
['p', notifyPubkey],
|
||||||
|
['k', kind.toString()],
|
||||||
],
|
],
|
||||||
content: '',
|
content: '',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user