mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-08 04:54:32 +00:00
check for note in initial de-duplication pass
This commit is contained in:
parent
919b97131b
commit
2536768133
1 changed files with 6 additions and 2 deletions
|
@ -207,9 +207,13 @@ function deduplicatePreviews(previews: Summary[]): Summary[] {
|
||||||
// Skip if we have AP and the other doesn't
|
// Skip if we have AP and the other doesn't
|
||||||
if (preview.activityPub && !p.activityPub) return false;
|
if (preview.activityPub && !p.activityPub) return false;
|
||||||
|
|
||||||
|
// Skip if we have a note and the other doesn't
|
||||||
|
if (preview.note && !p.note) return false;
|
||||||
|
|
||||||
// Skip later previews (keep the earliest instance)...
|
// Skip later previews (keep the earliest instance)...
|
||||||
// ...but only if we have AP or the later one doesn't.
|
// ...but only if we have AP or the later one doesn't...
|
||||||
if (i > index && (preview.activityPub || !p.activityPub)) return false;
|
// ...and only if we have note or the later one doesn't.
|
||||||
|
if (i > index && (preview.activityPub || !p.activityPub) && (preview.note || !p.note)) return false;
|
||||||
|
|
||||||
// If we get here, then "preview" is a duplicate of "p" and should be skipped.
|
// If we get here, then "preview" is a duplicate of "p" and should be skipped.
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue