Initial storage for Implementation of push notification

This commit is contained in:
Dan Peleg 2021-04-23 21:28:38 +03:00
parent d6e9b7b307
commit dd8b05c310
18 changed files with 537 additions and 0 deletions

View file

@ -36,6 +36,7 @@ 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
QueryPushers(ctx context.Context, req *QueryPushersRequest, res *QueryPushersResponse) error
QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error
QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, res *QueryDeviceInfosResponse) error
QuerySearchProfiles(ctx context.Context, req *QuerySearchProfilesRequest, res *QuerySearchProfilesResponse) error
@ -128,6 +129,17 @@ type QueryDevicesResponse struct {
Devices []Device
}
// QueryPushersRequest is the request for QueryPushers
type QueryPushersRequest struct {
UserID string
}
// QueryPushersResponse is the response for QueryPushers
type QueryPushersResponse struct {
UserExists bool
Pushers []Pusher
}
// QueryProfileRequest is the request for QueryProfile
type QueryProfileRequest struct {
// The user ID to query
@ -269,6 +281,25 @@ type Device struct {
AppserviceID string
}
// Pusher represents a push notification subscriber
type Pusher struct {
ID string
UserID string
PushKey string
Kind string
AppID string
AppDisplayName string
DeviceDisplayName string
ProfileTag string
Language string
Data PusherData
}
type PusherData struct {
URL string
Format string
}
// Account represents a Matrix account on this home server.
type Account struct {
UserID string