From aae9d3064bf746af8e926191f802de5e2654b304 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 2 Aug 2017 15:35:42 +0100 Subject: [PATCH] Doc getMembershipStateKey --- .../matrix-org/dendrite/clientapi/writers/membership.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/clientapi/writers/membership.go b/src/github.com/matrix-org/dendrite/clientapi/writers/membership.go index e075d69e1..630a43c54 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/writers/membership.go +++ b/src/github.com/matrix-org/dendrite/clientapi/writers/membership.go @@ -95,6 +95,11 @@ func SendMembership( } } +// getMembershipStateKey extracts the target user ID of a membership change. +// For "join" and "leave" this will be the ID of the user making the change. +// For "ban", "unban", "kick" and "invite" the target user ID will be in the JSON request body. +// In the latter case, if there was an issue retrieving the user ID from the request body, +// returns a JSONResponse with a corresponding error code and message. func getMembershipStateKey( req *http.Request, device *authtypes.Device, membership string, ) (stateKey string, reason string, response *util.JSONResponse) {