Documentation ¶
Index ¶
- type Handler
- func (h *Handler) Accumulate(userID, roomID, prevBatch string, timeline []json.RawMessage)
- func (h *Handler) AddToDeviceMessages(userID, deviceID string, msgs []json.RawMessage)
- func (h *Handler) EnsurePolling(p *pubsub.V3EnsurePolling)
- func (h *Handler) Initialise(roomID string, state []json.RawMessage)
- func (h *Handler) Listen()
- func (h *Handler) OnAccountData(userID, roomID string, events []json.RawMessage)
- func (h *Handler) OnE2EEData(userID, deviceID string, otkCounts map[string]int, fallbackKeyTypes []string, ...)
- func (h *Handler) OnInvite(userID, roomID string, inviteState []json.RawMessage)
- func (h *Handler) OnLeftRoom(userID, roomID string)
- func (h *Handler) OnReceipt(userID, roomID, ephEventType string, ephEvent json.RawMessage)
- func (h *Handler) OnTerminated(userID, deviceID string)
- func (h *Handler) SetTyping(roomID string, ephEvent json.RawMessage)
- func (h *Handler) StartV2Pollers()
- func (h *Handler) Teardown()
- func (h *Handler) UpdateDeviceSince(deviceID, since string)
- func (h *Handler) UpdateUnreadCounts(roomID, userID string, highlightCount, notifCount *int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler is responsible for starting v2 pollers at startup, processing v2 data and publishing updates, and receiving and processing EnsurePolling events.
func NewHandler ¶
func (*Handler) Accumulate ¶
func (h *Handler) Accumulate(userID, roomID, prevBatch string, timeline []json.RawMessage)
send room ID and prev batch, latest pos and event nids of timeline entries in NOTIFY. SELECT event nids for timeline.
func (*Handler) AddToDeviceMessages ¶
func (h *Handler) AddToDeviceMessages(userID, deviceID string, msgs []json.RawMessage)
Send nothing, the v3 API will pull from the DB directly; no in-memory shenanigans
func (*Handler) EnsurePolling ¶
func (h *Handler) EnsurePolling(p *pubsub.V3EnsurePolling)
func (*Handler) Initialise ¶
func (h *Handler) Initialise(roomID string, state []json.RawMessage)
send room ID and snapshot NID in NOTIFY, send nothing if already init'd.
func (*Handler) OnAccountData ¶
func (h *Handler) OnAccountData(userID, roomID string, events []json.RawMessage)
send user/room ID and types in NOTIFY, query account data. This can lose updates (most recent wins) but is probably fine
func (*Handler) OnE2EEData ¶
func (*Handler) OnInvite ¶
func (h *Handler) OnInvite(userID, roomID string, inviteState []json.RawMessage)
send user/room ID in NOTIFY, query state using user/room ID
func (*Handler) OnLeftRoom ¶
send all fields in NOTIFY
func (*Handler) OnReceipt ¶ added in v0.7.3
func (h *Handler) OnReceipt(userID, roomID, ephEventType string, ephEvent json.RawMessage)
func (*Handler) OnTerminated ¶ added in v0.5.1
func (*Handler) SetTyping ¶
func (h *Handler) SetTyping(roomID string, ephEvent json.RawMessage)
send all in NOTIFY
func (*Handler) StartV2Pollers ¶
func (h *Handler) StartV2Pollers()
func (*Handler) UpdateDeviceSince ¶
Emits nothing as no downstream components need it.
func (*Handler) UpdateUnreadCounts ¶
send all fields in NOTIFY