mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
hicli/pushrules: skip evaluating non-message events in initial sync
This commit is contained in:
parent
251c91490c
commit
0b59b2c733
1 changed files with 4 additions and 0 deletions
|
@ -92,6 +92,10 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *HiClient) evaluatePushRules(ctx context.Context, llSummary *mautrix.LazyLoadSummary, baseType database.UnreadType, evt *event.Event) database.UnreadType {
|
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{
|
should := h.PushRules.Load().GetMatchingRule(&pushRoom{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
roomID: evt.RoomID,
|
roomID: evt.RoomID,
|
||||||
|
|
Loading…
Add table
Reference in a new issue