From 0b59b2c73344e83342c72796d89f25b1488aa44c Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 20 Oct 2024 12:52:37 +0300 Subject: [PATCH] hicli/pushrules: skip evaluating non-message events in initial sync --- pkg/hicli/pushrules.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/hicli/pushrules.go b/pkg/hicli/pushrules.go index 088832d..1575e9a 100644 --- a/pkg/hicli/pushrules.go +++ b/pkg/hicli/pushrules.go @@ -92,6 +92,10 @@ var ( ) func (h *HiClient) evaluatePushRules(ctx context.Context, llSummary *mautrix.LazyLoadSummary, baseType database.UnreadType, evt *event.Event) database.UnreadType { + if !h.firstSyncReceived && baseType == database.UnreadTypeNone { + // Skip evaluating push rules that are unlikely to match for the initial sync + return baseType + } should := h.PushRules.Load().GetMatchingRule(&pushRoom{ ctx: ctx, roomID: evt.RoomID,