Relationships: fix blocks and mutes being switched
This commit is contained in:
parent
66bae5eea7
commit
7ad0e4d9e9
|
@ -6,13 +6,11 @@ async function renderRelationship(sourcePubkey: string, targetPubkey: string) {
|
|||
{ kinds: [3], authors: [sourcePubkey], limit: 1 },
|
||||
{ kinds: [3], authors: [targetPubkey], limit: 1 },
|
||||
{ kinds: [10000], authors: [sourcePubkey], limit: 1 },
|
||||
{ kinds: [10000], authors: [targetPubkey], limit: 1 },
|
||||
]);
|
||||
|
||||
const event3 = events.find((event) => event.kind === 3 && event.pubkey === sourcePubkey);
|
||||
const target3 = events.find((event) => event.kind === 3 && event.pubkey === targetPubkey);
|
||||
const event10000 = events.find((event) => event.kind === 10000 && event.pubkey === sourcePubkey);
|
||||
const target10000 = events.find((event) => event.kind === 10000 && event.pubkey === targetPubkey);
|
||||
|
||||
return {
|
||||
id: targetPubkey,
|
||||
|
@ -20,9 +18,9 @@ async function renderRelationship(sourcePubkey: string, targetPubkey: string) {
|
|||
showing_reblogs: true,
|
||||
notifying: false,
|
||||
followed_by: target3 ? hasTag(target3?.tags, ['p', sourcePubkey]) : false,
|
||||
blocking: event10000 ? hasTag(event10000.tags, ['p', targetPubkey]) : false,
|
||||
blocked_by: target10000 ? hasTag(target10000.tags, ['p', sourcePubkey]) : false,
|
||||
muting: false,
|
||||
blocking: false,
|
||||
blocked_by: false,
|
||||
muting: event10000 ? hasTag(event10000.tags, ['p', targetPubkey]) : false,
|
||||
muting_notifications: false,
|
||||
requested: false,
|
||||
domain_blocking: false,
|
||||
|
|
Loading…
Reference in New Issue