aboutsummaryrefslogtreecommitdiff
path: root/federationapi/consumers/presence.go
diff options
context:
space:
mode:
Diffstat (limited to 'federationapi/consumers/presence.go')
-rw-r--r--federationapi/consumers/presence.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/federationapi/consumers/presence.go b/federationapi/consumers/presence.go
index a65d2aa0..e76103cd 100644
--- a/federationapi/consumers/presence.go
+++ b/federationapi/consumers/presence.go
@@ -69,14 +69,15 @@ func (t *OutputPresenceConsumer) Start() error {
return nil
}
return jetstream.JetStreamConsumer(
- t.ctx, t.jetstream, t.topic, t.durable, t.onMessage,
+ t.ctx, t.jetstream, t.topic, t.durable, 1, t.onMessage,
nats.DeliverAll(), nats.ManualAck(), nats.HeadersOnly(),
)
}
// onMessage is called in response to a message received on the presence
// events topic from the client api.
-func (t *OutputPresenceConsumer) onMessage(ctx context.Context, msg *nats.Msg) bool {
+func (t *OutputPresenceConsumer) onMessage(ctx context.Context, msgs []*nats.Msg) bool {
+ msg := msgs[0] // Guaranteed to exist if onMessage is called
// only send presence events which originated from us
userID := msg.Header.Get(jetstream.UserID)
_, serverName, err := gomatrixserverlib.SplitID('@', userID)