mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
federation/client: Add key query and claim endpoints too
Some checks failed
Some checks failed
This commit is contained in:
parent
54d5cefecf
commit
132bfbcef4
1 changed files with 10 additions and 0 deletions
|
|
@ -445,6 +445,16 @@ func (c *Client) GetUserDevices(ctx context.Context, serverName string, userID i
|
|||
return resp, c.MakeRequest(ctx, serverName, true, http.MethodGet, URLPath{"v1", "user", "devices", userID}, nil, &resp)
|
||||
}
|
||||
|
||||
// QueryUserKeys Returns the current devices and identity keys for the given users.
|
||||
func (c *Client) QueryUserKeys(ctx context.Context, serverName string, req *mautrix.ReqQueryKeys) (resp *mautrix.RespQueryKeys, err error) {
|
||||
return resp, c.MakeRequest(ctx, serverName, true, http.MethodPost, URLPath{"v1", "user", "keys", "query"}, req, &resp)
|
||||
}
|
||||
|
||||
// ClaimUserKeys Claims one-time keys for use in pre-key messages.
|
||||
func (c *Client) ClaimUserKeys(ctx context.Context, serverName string, req *mautrix.ReqClaimKeys) (resp *mautrix.RespClaimKeys, err error) {
|
||||
return resp, c.MakeRequest(ctx, serverName, true, http.MethodPost, URLPath{"v1", "user", "keys", "claim"}, req, &resp)
|
||||
}
|
||||
|
||||
type URLPath []any
|
||||
|
||||
func (fup URLPath) FullPath() []any {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue