fix kind 1 boosts

This commit is contained in:
Martti Malmi 2023-01-27 15:42:43 +02:00
parent cfb11c482b
commit ea2630a49f
2 changed files with 9 additions and 2 deletions

View File

@ -816,7 +816,14 @@ export default {
return undefined;
},
handleBoost(event: Event) {
const id = event.tags.reverse().find((tag: any) => tag[0] === 'e')?.[1]; // last e tag is the liked post
let id = event.tags.find((tag) => tag[0] === 'e' && tag[3] === 'mention')?.[1];
if (!id) {
// last e tag is the boosted post
id = event.tags
.slice() // so we don't reverse event.tags in place
.reverse()
.find((tag: any) => tag[0] === 'e')?.[1];
}
if (!id) return;
if (!this.boostsByMessageId.has(id)) {
this.boostsByMessageId.set(id, new Set());

View File

@ -220,7 +220,7 @@ class PublicMessage extends Message {
const nostrId = Nostr.toNostrHexAddress(this.props.hash);
if (nostrId) {
Nostr.publish({
kind: 6,
kind: 1,
tags: [
['e', nostrId, '', 'mention'],
['p', author],