Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,13 @@ func (cli *Client) UnstableSetLockStatus(ctx context.Context, userID id.UserID,
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) {
_, err = cli.MakeFullRequest(ctx, FullRequest{
Method: http.MethodPost,
Expand Down
10 changes: 9 additions & 1 deletion responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,15 @@ type RespRedactUserEvents struct {

// RespMediaConfig is the JSON response for https://spec.matrix.org/v1.4/client-server-api/#get_matrixmediav3config
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
Expand Down