MCPcopy Create free account
hub / github.com/daodst/chat / SendEvents

Function SendEvents

roomserver/api/wrapper.go:25–43  ·  view source on GitHub ↗

SendEvents to the roomserver The events are written with KindNew.

(
	ctx context.Context, rsAPI InputRoomEventsAPI,
	kind Kind, events []*gomatrixserverlib.HeaderedEvent,
	origin gomatrixserverlib.ServerName,
	sendAsServer gomatrixserverlib.ServerName, txnID *TransactionID,
	async bool,
)

Source from the content-addressed store, hash-verified

23
24// SendEvents to the roomserver The events are written with KindNew.
25func SendEvents(
26 ctx context.Context, rsAPI InputRoomEventsAPI,
27 kind Kind, events []*gomatrixserverlib.HeaderedEvent,
28 origin gomatrixserverlib.ServerName,
29 sendAsServer gomatrixserverlib.ServerName, txnID *TransactionID,
30 async bool,
31) error {
32 ires := make([]InputRoomEvent, len(events))
33 for i, event := range events {
34 ires[i] = InputRoomEvent{
35 Kind: kind,
36 Event: event,
37 Origin: origin,
38 SendAsServer: string(sendAsServer),
39 TransactionID: txnID,
40 }
41 }
42 return SendInputRoomEvents(ctx, rsAPI, ires, async)
43}
44
45// SendEventWithState writes an event with the specified kind to the roomserver
46// with the state at the event as KindOutlier before it. Will not send any event that is

Callers

nothing calls this directly

Calls 1

SendInputRoomEventsFunction · 0.85

Tested by

no test coverage detected