aboutsummaryrefslogtreecommitdiff
path: root/userapi/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/api/api.go')
-rw-r--r--userapi/api/api.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/userapi/api/api.go b/userapi/api/api.go
index 3ed9252c..1578268a 100644
--- a/userapi/api/api.go
+++ b/userapi/api/api.go
@@ -14,13 +14,18 @@
package api
-import "context"
+import (
+ "context"
+
+ "github.com/matrix-org/gomatrixserverlib"
+)
// UserInternalAPI is the internal API for information about users and devices.
type UserInternalAPI interface {
QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error
QueryAccessToken(ctx context.Context, req *QueryAccessTokenRequest, res *QueryAccessTokenResponse) error
QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error
+ QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error
}
// QueryAccessTokenRequest is the request for QueryAccessToken
@@ -37,6 +42,22 @@ type QueryAccessTokenResponse struct {
Err error // e.g ErrorForbidden
}
+// QueryAccountDataRequest is the request for QueryAccountData
+type QueryAccountDataRequest struct {
+ UserID string // required: the user to get account data for.
+ // TODO: This is a terribly confusing API shape :/
+ DataType string // optional: if specified returns only a single event matching this data type.
+ // optional: Only used if DataType is set. If blank returns global account data matching the data type.
+ // If set, returns only room account data matching this data type.
+ RoomID string
+}
+
+// QueryAccountDataResponse is the response for QueryAccountData
+type QueryAccountDataResponse struct {
+ GlobalAccountData []gomatrixserverlib.ClientEvent
+ RoomAccountData map[string][]gomatrixserverlib.ClientEvent
+}
+
// QueryDevicesRequest is the request for QueryDevices
type QueryDevicesRequest struct {
UserID string