extensions

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 E2EEFetcher added in v0.99.0

type E2EEFetcher interface {
	DeviceData(userID, deviceID string, isInitial bool) *internal.DeviceData
}

Fetcher used by the E2EE extension

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 E2EEFetcher, userID, deviceID string, req *E2EERequest, isInitial bool) (res *E2EEResponse)

func ProcessLiveE2EE added in v0.98.1

func ProcessLiveE2EE(up caches.Update, fetcher E2EEFetcher, userID, deviceID string, req *E2EERequest) (res *E2EEResponse)

func (*E2EEResponse) HasData

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

type Handler

type Handler struct {
	Store       *state.Storage
	E2EEFetcher E2EEFetcher
	GlobalCache *caches.GlobalCache
}

func (*Handler) Handle

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

type ReceiptsRequest

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

Client created request params

func (ReceiptsRequest) ApplyDelta

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

type ReceiptsResponse

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

Server response

func ProcessLiveReceipts

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

func ProcessReceipts

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

func (*ReceiptsResponse) HasData

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 ProcessLiveToDeviceEvents added in v0.98.1

func ProcessLiveToDeviceEvents(up caches.Update, store *state.Storage, userID, deviceID string, req *ToDeviceRequest) (res *ToDeviceResponse)

func ProcessToDevice

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

func (*ToDeviceResponse) HasData

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

type TypingRequest

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

Client created request params

func (TypingRequest) ApplyDelta

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

type TypingResponse

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

Server response

func ProcessLiveTyping

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

func ProcessTyping

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

func (*TypingResponse) HasData

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