Send notifications if applicable when using beeper batch sending
This commit is contained in:
parent
c88e5ec550
commit
3fc26339d8
1 changed files with 11 additions and 3 deletions
10
backfill.go
10
backfill.go
|
@ -239,9 +239,17 @@ func (portal *Portal) backfillSendBatch(ctx context.Context, converted []*Conver
|
||||||
dbMessages = append(dbMessages, dbm)
|
dbMessages = append(dbMessages, dbm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
forward := true
|
||||||
|
log.Debug().
|
||||||
|
Int("event_count", len(events)).
|
||||||
|
Bool("forward", forward).
|
||||||
|
Bool("mark_read", markReadBy != "").
|
||||||
|
Bool("notify", markReadBy == "").
|
||||||
|
Msg("Sending batch of messages")
|
||||||
_, err := portal.MainIntent().BeeperBatchSend(portal.MXID, &mautrix.ReqBeeperBatchSend{
|
_, err := portal.MainIntent().BeeperBatchSend(portal.MXID, &mautrix.ReqBeeperBatchSend{
|
||||||
Forward: true,
|
Forward: forward,
|
||||||
MarkReadBy: markReadBy,
|
MarkReadBy: markReadBy,
|
||||||
|
SendNotification: forward && markReadBy == "",
|
||||||
Events: events,
|
Events: events,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue