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
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")
return false
}
@ -155,12 +155,9 @@ func (s *OutputRoomEventConsumer) onMessage(
return true
}
// filterRoomserverEvents takes in events and decides whether any of them need
// to be passed on to an external application service. It does this by checking
// each namespace of each registered application service, and if there is a
// match, adds the event to the queue for events to be sent to a particular
// application service.
func (s *OutputRoomEventConsumer) filterRoomserverEvents(
// sendEvents passes events to the appservice by using the transactions
// endpoint. It will block for the backoff period if necessary.
func (s *OutputRoomEventConsumer) sendEvents(
ctx context.Context, state *appserviceState,
events []*gomatrixserverlib.HeaderedEvent,
) error {