diff options
author | FChannel <> | 2021-10-09 09:28:20 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:52:40 -0700 |
commit | ccdbe6fda1c783be80e74fcb97a10bef8d0de24d (patch) | |
tree | b21564f812e8a75453944d5d4ee94478f8ed04d9 /outboxPost.go | |
parent | eeffffe40cd28e3afd3f055b2114d67a99d4ba9f (diff) |
fix for federating issue when everyone is not following each other and comments are lost.
Diffstat (limited to 'outboxPost.go')
-rw-r--r-- | outboxPost.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/outboxPost.go b/outboxPost.go index 65b9929..22a0d1c 100644 --- a/outboxPost.go +++ b/outboxPost.go @@ -550,6 +550,7 @@ func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { WriteObjectToCache(db, *activity.Object) ArchivePosts(db, GetActorFromDB(db, e)) + SendToFollowers(db, e, activity) } } } @@ -683,3 +684,26 @@ func IsMediaBanned(db *sql.DB, f multipart.File) bool { return false } + +func SendToFollowers(db *sql.DB, actor string, activity Activity) { + + nActor := GetActorFromDB(db, actor) + activity.Actor = &nActor + + followers := GetActorFollowDB(db, actor) + var to []string + + for _, e := range followers { + for _, k := range activity.To { + if e.Id != k { + to = append(to, e.Id) + } + } + } + + activity.To = to + + if len(activity.Object.InReplyTo) > 0 { + MakeActivityRequest(db, activity) + } +} |