mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
client: Implement MSC4034 bodies and endpoint
This commit is contained in:
parent
6e7b692098
commit
98e3b534c1
2 changed files with 16 additions and 1 deletions
|
|
@ -2729,6 +2729,13 @@ func (cli *Client) UnstableSetLockStatus(ctx context.Context, userID id.UserID,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnstableGetStorageUsage queries MSC4034 storage usage information for the current account.
|
||||||
|
func (cli *Client) UnstableGetStorageUsage(ctx context.Context) (resp *RespStorageUsage, err error) {
|
||||||
|
urlPath := cli.BuildClientURL("unstable", "org.matrix.msc4034", "usage")
|
||||||
|
_, err = cli.MakeRequest(ctx, http.MethodGet, urlPath, nil, &resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (cli *Client) AppservicePing(ctx context.Context, id, txnID string) (resp *RespAppservicePing, err error) {
|
func (cli *Client) AppservicePing(ctx context.Context, id, txnID string) (resp *RespAppservicePing, err error) {
|
||||||
_, err = cli.MakeFullRequest(ctx, FullRequest{
|
_, err = cli.MakeFullRequest(ctx, FullRequest{
|
||||||
Method: http.MethodPost,
|
Method: http.MethodPost,
|
||||||
|
|
|
||||||
10
responses.go
10
responses.go
|
|
@ -132,7 +132,15 @@ type RespRedactUserEvents struct {
|
||||||
|
|
||||||
// RespMediaConfig is the JSON response for https://spec.matrix.org/v1.4/client-server-api/#get_matrixmediav3config
|
// RespMediaConfig is the JSON response for https://spec.matrix.org/v1.4/client-server-api/#get_matrixmediav3config
|
||||||
type RespMediaConfig struct {
|
type RespMediaConfig struct {
|
||||||
UploadSize int64 `json:"m.upload.size,omitempty"`
|
UploadSize int64 `json:"m.upload.size,omitempty"`
|
||||||
|
UnstableStorageSize *int64 `json:"org.matrix.msc4034.storage.size,omitempty"`
|
||||||
|
UnstableStorageFiles *int64 `json:"org.matrix.msc4034.storage.max_files,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RespStorageUsage is the JSON response for https://github.com/matrix-org/matrix-spec-proposals/pull/4034
|
||||||
|
type RespStorageUsage struct {
|
||||||
|
Used *int64 `json:"org.matrix.msc4034.storage.used,omitempty"`
|
||||||
|
Files *int64 `json:"org.matrix.msc4034.storage.files,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RespMediaUpload is the JSON response for https://spec.matrix.org/v1.2/client-server-api/#post_matrixmediav3upload
|
// RespMediaUpload is the JSON response for https://spec.matrix.org/v1.2/client-server-api/#post_matrixmediav3upload
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue