extensions

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountDataRequest

type AccountDataRequest struct {
	Enabled bool `json:"enabled"`
}

Client created request params

func (AccountDataRequest) ApplyDelta

type AccountDataResponse

type AccountDataResponse struct {
	Global []json.RawMessage            `json:"global,omitempty"`
	Rooms  map[string][]json.RawMessage `json:"rooms,omitempty"`
}

Server response

func ProcessAccountData

func ProcessAccountData(store *state.Storage, listRoomIDs map[string]struct{}, userID string, isInitial bool, req *AccountDataRequest) (res *AccountDataResponse)

func ProcessLiveAccountData

func ProcessLiveAccountData(up caches.Update, store *state.Storage, updateWillReturnResponse bool, userID string, req *AccountDataRequest) (res *AccountDataResponse)

func (*AccountDataResponse) HasData

func (r *AccountDataResponse) HasData(isInitial bool) bool

type E2EEDeviceList

type E2EEDeviceList struct {
	Changed []string `json:"changed"`
	Left    []string `json:"left"`
}

type E2EERequest

type E2EERequest struct {
	Enabled bool `json:"enabled"`
}

Client created request params

func (E2EERequest) ApplyDelta

func (r E2EERequest) ApplyDelta(next *E2EERequest) *E2EERequest

type E2EEResponse

type E2EEResponse struct {
	OTKCounts        map[string]int  `json:"device_one_time_keys_count,omitempty"`
	DeviceLists      *E2EEDeviceList `json:"device_lists,omitempty"`
	FallbackKeyTypes []string        `json:"device_unused_fallback_key_types,omitempty"`
}

Server response

func ProcessE2EE

func ProcessE2EE(fetcher sync2.E2EEFetcher, userID, deviceID string, req *E2EERequest, isInitial bool) (res *E2EEResponse)

func (*E2EEResponse) HasData

func (r *E2EEResponse) HasData(isInitial bool) bool

type Handler

type Handler struct {
	Store       *state.Storage
	E2EEFetcher sync2.E2EEFetcher
}

func (*Handler) Handle

func (h *Handler) Handle(req Request, listRoomIDs map[string]struct{}, isInitial bool) (res Response)

func (*Handler) HandleLiveUpdate

func (h *Handler) HandleLiveUpdate(update caches.Update, req Request, res *Response, updateWillReturnResponse, isInitial bool)

type HandlerInterface

type HandlerInterface interface {
	Handle(req Request, listRoomIDs map[string]struct{}, isInitial bool) (res Response)
	HandleLiveUpdate(update caches.Update, req Request, res *Response, updateWillReturnResponse, isInitial bool)
}

type Request

type Request struct {
	UserID      string
	DeviceID    string
	ToDevice    *ToDeviceRequest    `json:"to_device"`
	E2EE        *E2EERequest        `json:"e2ee"`
	AccountData *AccountDataRequest `json:"account_data"`
}

func (Request) ApplyDelta

func (r Request) ApplyDelta(next *Request) Request

type Response

type Response struct {
	ToDevice    *ToDeviceResponse    `json:"to_device,omitempty"`
	E2EE        *E2EEResponse        `json:"e2ee,omitempty"`
	AccountData *AccountDataResponse `json:"account_data,omitempty"`
}

func (Response) HasData

func (e Response) HasData(isInitial bool) bool

type ToDeviceRequest

type ToDeviceRequest struct {
	Enabled *bool  `json:"enabled"`
	Limit   int    `json:"limit"` // max number of to-device messages per response
	Since   string `json:"since"` // since token
}

Client created request params

func (ToDeviceRequest) ApplyDelta

func (r ToDeviceRequest) ApplyDelta(next *ToDeviceRequest) *ToDeviceRequest

type ToDeviceResponse

type ToDeviceResponse struct {
	NextBatch string            `json:"next_batch"`
	Events    []json.RawMessage `json:"events,omitempty"`
}

Server response

func ProcessToDevice

func ProcessToDevice(store *state.Storage, userID, deviceID string, req *ToDeviceRequest) (res *ToDeviceResponse)

func (*ToDeviceResponse) HasData

func (r *ToDeviceResponse) HasData(isInitial bool) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL