mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-20 01:56:33 +00:00
fix kind 1 boosts
This commit is contained in:
parent
cfb11c482b
commit
ea2630a49f
@ -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());
|
||||
|
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user