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,
|
||||
reactionTypes: reactionTypes ?? { type: 'LikeDislike', content: '+' },
|
||||
eventId: eventIdNonNull,
|
||||
kind: props.event.kind,
|
||||
notifyPubkey: props.event.pubkey,
|
||||
});
|
||||
setReacted(true);
|
||||
@@ -185,6 +186,7 @@ const RepostAction = (props: { event: NostrEvent }) => {
|
||||
relayUrls: config().relayUrls,
|
||||
pubkey: pubkeyNonNull,
|
||||
eventId: eventIdNonNull,
|
||||
kind: props.event.kind,
|
||||
notifyPubkey: props.event.pubkey,
|
||||
});
|
||||
setReposted(true);
|
||||
@@ -269,6 +271,7 @@ const EmojiReactions: Component<{ event: NostrEvent }> = (props) => {
|
||||
pubkey: pubkeyNonNull,
|
||||
reactionTypes: reactionTypes ?? { type: 'LikeDislike', content: '+' },
|
||||
eventId: eventIdNonNull,
|
||||
kind: props.event.kind,
|
||||
notifyPubkey: props.event.pubkey,
|
||||
});
|
||||
setReacted(true);
|
||||
|
||||
@@ -123,18 +123,21 @@ const useCommands = () => {
|
||||
relayUrls,
|
||||
pubkey,
|
||||
eventId,
|
||||
kind,
|
||||
reactionTypes,
|
||||
notifyPubkey,
|
||||
}: {
|
||||
relayUrls: string[];
|
||||
pubkey: string;
|
||||
eventId: string;
|
||||
kind: number;
|
||||
reactionTypes: ReactionTypes;
|
||||
notifyPubkey: string;
|
||||
}): Promise<Promise<void>[]> => {
|
||||
const tags = [
|
||||
['e', eventId, ''],
|
||||
['p', notifyPubkey],
|
||||
['k', kind.toString()],
|
||||
];
|
||||
|
||||
if (reactionTypes.type === 'CustomEmoji') {
|
||||
@@ -156,20 +159,23 @@ const useCommands = () => {
|
||||
relayUrls,
|
||||
pubkey,
|
||||
eventId,
|
||||
kind,
|
||||
notifyPubkey,
|
||||
}: {
|
||||
relayUrls: string[];
|
||||
pubkey: string;
|
||||
eventId: string;
|
||||
kind: number;
|
||||
notifyPubkey: string;
|
||||
}): Promise<Promise<void>[]> => {
|
||||
const preSignedEvent: UnsignedEvent = {
|
||||
kind: 6 as Kind,
|
||||
kind: kind === 1 ? Kind.Repost : 16 /* generic repost */,
|
||||
pubkey,
|
||||
created_at: epoch(),
|
||||
tags: [
|
||||
['e', eventId, ''],
|
||||
['p', notifyPubkey],
|
||||
['k', kind.toString()],
|
||||
],
|
||||
content: '',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user