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) {
|
||||
const tags = all ? gather_reply_tags(pubkey, ev) : new_reply_tags(ev);
|
||||
const created_at = new_creation_time();
|
||||
let kind = ev.kind;
|
||||
|
||||
// convert emoji replies into reactions
|
||||
if (is_valid_reaction_content(content))
|
||||
kind = 7;
|
||||
if (is_valid_reaction_content(content)) {
|
||||
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 = {
|
||||
pubkey,
|
||||
tags,
|
||||
content,
|
||||
created_at,
|
||||
kind
|
||||
}
|
||||
};
|
||||
reply.id = await nostrjs.calculate_id(reply)
|
||||
reply = await sign_event(reply)
|
||||
return reply
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue