mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
Implement membership APIs (#171)
* Implement membership endpoints * Use FillBuilder when possible * Fix typo in membership event content * Fix state key invite membership events not being correctly set * Set membership content to match the profile of the user in state_key * Move event building and rename common function * Doc getMembershipStateKey * Check if user is local before lookin up their profile
This commit is contained in:
parent
03dd456b47
commit
8ccc5d108b
6 changed files with 241 additions and 71 deletions
|
@ -81,6 +81,12 @@ func Setup(
|
|||
)
|
||||
}),
|
||||
)
|
||||
r0mux.Handle("/rooms/{roomID}/{membership:(?:join|kick|ban|unban|leave|invite)}",
|
||||
common.MakeAuthAPI("membership", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
||||
vars := mux.Vars(req)
|
||||
return writers.SendMembership(req, accountDB, device, vars["roomID"], vars["membership"], cfg, queryAPI, producer)
|
||||
}),
|
||||
).Methods("POST", "OPTIONS")
|
||||
r0mux.Handle("/rooms/{roomID}/send/{eventType}/{txnID}",
|
||||
common.MakeAuthAPI("send_message", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
||||
vars := mux.Vars(req)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue