Fixes for reacting with emoji only
This commit is contained in:
parent
fa8bdc0b2b
commit
c498349c35
1 changed files with 7 additions and 6 deletions
13
js/core.js
13
js/core.js
|
@ -137,20 +137,21 @@ function new_reply_tags(ev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function create_reply(pubkey, content, ev, all=true) {
|
async function create_reply(pubkey, content, ev, all=true) {
|
||||||
const tags = all ? gather_reply_tags(pubkey, ev) : new_reply_tags(ev);
|
|
||||||
const created_at = new_creation_time();
|
|
||||||
let kind = ev.kind;
|
let kind = ev.kind;
|
||||||
|
|
||||||
// convert emoji replies into reactions
|
// convert emoji replies into reactions
|
||||||
if (is_valid_reaction_content(content))
|
if (is_valid_reaction_content(content)) {
|
||||||
kind = 7;
|
kind = KIND_REACTION;
|
||||||
|
}
|
||||||
|
const tags = kind != KIND_REACTION && all
|
||||||
|
? gather_reply_tags(pubkey, ev) : new_reply_tags(ev);
|
||||||
|
const created_at = new_creation_time();
|
||||||
let reply = {
|
let reply = {
|
||||||
pubkey,
|
pubkey,
|
||||||
tags,
|
tags,
|
||||||
content,
|
content,
|
||||||
created_at,
|
created_at,
|
||||||
kind
|
kind
|
||||||
}
|
};
|
||||||
reply.id = await nostrjs.calculate_id(reply)
|
reply.id = await nostrjs.calculate_id(reply)
|
||||||
reply = await sign_event(reply)
|
reply = await sign_event(reply)
|
||||||
return reply
|
return reply
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue