extensions

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 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, roomIDToTimeline map[string][]string, 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
	GlobalCache *caches.GlobalCache
}

func (*Handler) Handle

func (h *Handler) Handle(req Request, roomIDToTimeline map[string][]string, 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, roomIDToTimeline map[string][]string, isInitial bool) (res Response)
	HandleLiveUpdate(update caches.Update, req Request, res *Response, updateWillReturnResponse, isInitial bool)
}

type ReceiptsRequest added in v0.7.3

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

Client created request params

func (ReceiptsRequest) ApplyDelta added in v0.7.3

func (r ReceiptsRequest) ApplyDelta(next *ReceiptsRequest) *ReceiptsRequest

type ReceiptsResponse added in v0.7.3

type ReceiptsResponse struct {
	// room_id -> m.receipt ephemeral event
	Rooms map[string]json.RawMessage `json:"rooms,omitempty"`
}

Server response

func ProcessLiveReceipts added in v0.7.3

func ProcessLiveReceipts(up caches.Update, updateWillReturnResponse bool, userID string, req *ReceiptsRequest) (res *ReceiptsResponse)

func ProcessReceipts added in v0.7.3

func ProcessReceipts(store *state.Storage, roomIDToTimeline map[string][]string, userID string, isInitial bool, req *ReceiptsRequest) (res *ReceiptsResponse)

func (*ReceiptsResponse) HasData added in v0.7.3

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

type Request

type Request struct {
	UserID      string
	DeviceID    string
	ToDevice    *ToDeviceRequest    `json:"to_device"`
	E2EE        *E2EERequest        `json:"e2ee"`
	AccountData *AccountDataRequest `json:"account_data"`
	Typing      *TypingRequest      `json:"typing"`
	Receipts    *ReceiptsRequest    `json:"receipts"`
}

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"`
	Typing      *TypingResponse      `json:"typing,omitempty"`
	Receipts    *ReceiptsResponse    `json:"receipts,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

type TypingRequest added in v0.7.2

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

Client created request params

func (TypingRequest) ApplyDelta added in v0.7.2

func (r TypingRequest) ApplyDelta(next *TypingRequest) *TypingRequest

type TypingResponse added in v0.7.2

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

Server response

func ProcessLiveTyping added in v0.7.2

func ProcessLiveTyping(up caches.Update, updateWillReturnResponse bool, userID string, req *TypingRequest) (res *TypingResponse)

func ProcessTyping added in v0.7.2

func ProcessTyping(globalCache *caches.GlobalCache, roomIDToTimeline map[string][]string, userID string, isInitial bool, req *TypingRequest) (res *TypingResponse)

func (*TypingResponse) HasData added in v0.7.2

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

Jump to

Keyboard shortcuts

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