anbot

9d3e7fc / sync.mjs

View file at this commit

diff --git a/sync.mjs b/sync.mjs
index 07f5150..a1795a0 100644
--- a/sync.mjs
+++ b/sync.mjs
@@ -150,8 +150,10 @@ export async function pull(store, baseUrl, options = {}) {
     repoId = repos[0].record.id
   }
 
+  const publisher = recordAuthor(repos.find(({ record }) => record.id === repoId).record)
   const held = verified.filter(({ record, body }) =>
-    (isGitRepo(body) && record.id === repoId) || belongsToRepo(body, repoId) ||
+    (isGitRepo(body) && record.id === repoId) ||
+    (belongsToRepo(body, repoId) && recordAuthor(record) === publisher) ||
     (body?.anbot === 1 && body.type === 'post'))
   // Snapshot what was already held before storing: the chain walk stops at
   // records held before this pull, not at records this pull just stored.
@@ -167,7 +169,7 @@ export async function pull(store, baseUrl, options = {}) {
 
   const updates = []
   for (const entry of verified) {
-    if (!isGitUpdate(entry.body, repoId)) continue
+    if (!isGitUpdate(entry.body, repoId) || recordAuthor(entry.record) !== publisher) continue
     updates.push({ ...entry, timestamp: envelopeTimestamp(entry.record.signature) })
   }
   requireThat(updates.length > 0, 'Remote has no updates')

Git ยท Social feed