summaryrefslogtreecommitdiff
path: root/internal/message/fediprocess.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-15 11:58:11 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-15 11:58:11 +0200
commitcc48294c31a76e94fa879ad0d8d5dbd7e94c651b (patch)
tree7c26d33b41bab33bbdfbba540958444f4c296602 /internal/message/fediprocess.go
parentMediahandler (#21) (diff)
downloadgotosocial-cc48294c31a76e94fa879ad0d8d5dbd7e94c651b.tar.xz
Inbox post (#22)
Inbox POST from federated servers now working for statuses and follow requests. Follow request client API added. Start work on federating outgoing messages. Other fixes and changes/tidying up.
Diffstat (limited to 'internal/message/fediprocess.go')
-rw-r--r--internal/message/fediprocess.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/message/fediprocess.go b/internal/message/fediprocess.go
index dad1e848c..133e7dbaa 100644
--- a/internal/message/fediprocess.go
+++ b/internal/message/fediprocess.go
@@ -1,6 +1,7 @@
package message
import (
+ "context"
"fmt"
"net/http"
@@ -8,6 +9,7 @@ import (
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/util"
)
// authenticateAndDereferenceFediRequest authenticates the HTTP signature of an incoming federation request, using the given
@@ -130,3 +132,9 @@ func (p *processor) GetWebfingerAccount(requestedUsername string, request *http.
},
}, nil
}
+
+func (p *processor) InboxPost(ctx context.Context, w http.ResponseWriter, r *http.Request) (bool, error) {
+ contextWithChannel := context.WithValue(ctx, util.APFromFederatorChanKey, p.fromFederator)
+ posted, err := p.federator.FederatingActor().PostInbox(contextWithChannel, w, r)
+ return posted, err
+}