Rename function

This commit is contained in:
Neil Alexander 2022-08-31 15:09:52 +01:00
parent b202c6f889
commit 2ceff09003
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -147,7 +147,7 @@ func (s *OutputRoomEventConsumer) onMessage(
} }
// Send event to any relevant application services // Send event to any relevant application services
if err := s.filterRoomserverEvents(ctx, state, events); err != nil { if err := s.sendEvents(ctx, state, events); err != nil {
log.WithField("appservice", state.ID).WithError(err).Errorf("Appservice failed to filter events") log.WithField("appservice", state.ID).WithError(err).Errorf("Appservice failed to filter events")
return false return false
} }
@ -155,12 +155,9 @@ func (s *OutputRoomEventConsumer) onMessage(
return true return true
} }
// filterRoomserverEvents takes in events and decides whether any of them need // sendEvents passes events to the appservice by using the transactions
// to be passed on to an external application service. It does this by checking // endpoint. It will block for the backoff period if necessary.
// each namespace of each registered application service, and if there is a func (s *OutputRoomEventConsumer) sendEvents(
// match, adds the event to the queue for events to be sent to a particular
// application service.
func (s *OutputRoomEventConsumer) filterRoomserverEvents(
ctx context.Context, state *appserviceState, ctx context.Context, state *appserviceState,
events []*gomatrixserverlib.HeaderedEvent, events []*gomatrixserverlib.HeaderedEvent,
) error { ) error {