summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing/thread.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-10-23 10:58:13 +0100
committerLibravatar GitHub <noreply@github.com>2023-10-23 10:58:13 +0100
commit69ba9a79a13b21af98d67bbd0802aecb49147f3f (patch)
treef9dcd19ff6ef3711aadb684633cd0100fceb6b27 /internal/federation/dereferencing/thread.go
parent[chore]: Bump github.com/coreos/go-oidc/v3 from 3.6.0 to 3.7.0 (#2284) (diff)
downloadgotosocial-69ba9a79a13b21af98d67bbd0802aecb49147f3f.tar.xz
[chore] de-interface{} the federator and dereferencer structs (#2285)
* de-interface{} the federator and dereferencer structs * fix broken type signatures
Diffstat (limited to 'internal/federation/dereferencing/thread.go')
-rw-r--r--internal/federation/dereferencing/thread.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/internal/federation/dereferencing/thread.go b/internal/federation/dereferencing/thread.go
index 6d8c913c7..5753ce4dd 100644
--- a/internal/federation/dereferencing/thread.go
+++ b/internal/federation/dereferencing/thread.go
@@ -38,7 +38,7 @@ import (
// ancesters we are willing to follow before returning error.
const maxIter = 1000
-func (d *deref) dereferenceThread(ctx context.Context, username string, statusIRI *url.URL, status *gtsmodel.Status, statusable ap.Statusable) {
+func (d *Dereferencer) dereferenceThread(ctx context.Context, username string, statusIRI *url.URL, status *gtsmodel.Status, statusable ap.Statusable) {
// Ensure that ancestors have been fully dereferenced
if err := d.DereferenceStatusAncestors(ctx, username, status); err != nil {
log.Error(ctx, err)
@@ -50,11 +50,8 @@ func (d *deref) dereferenceThread(ctx context.Context, username string, statusIR
}
}
-func (d *deref) DereferenceStatusAncestors(
- ctx context.Context,
- username string,
- status *gtsmodel.Status,
-) error {
+// DereferenceStatusAncestors iterates upwards from the given status, using InReplyToURI, to ensure that as many parent statuses as possible are dereferenced.
+func (d *Dereferencer) DereferenceStatusAncestors(ctx context.Context, username string, status *gtsmodel.Status) error {
// Start log entry with fields
l := log.WithContext(ctx).
WithFields(kv.Fields{
@@ -220,7 +217,8 @@ func (d *deref) DereferenceStatusAncestors(
return gtserror.Newf("reached %d ancestor iterations for %q", maxIter, status.URI)
}
-func (d *deref) DereferenceStatusDescendants(ctx context.Context, username string, statusIRI *url.URL, parent ap.Statusable) error {
+// DereferenceStatusDescendents iterates downwards from the given status, using its replies, to ensure that as many children statuses as possible are dereferenced.
+func (d *Dereferencer) DereferenceStatusDescendants(ctx context.Context, username string, statusIRI *url.URL, parent ap.Statusable) error {
statusIRIStr := statusIRI.String()
// Start log entry with fields