mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 10:03:09 -06:00
Disable the updated check to enable marking messages > 1 day old as read
I couldn’t clear notifications for messages greater than 1 day old because they no longer existed :)
This commit is contained in:
parent
4e30e03345
commit
af369c34cb
|
|
@ -95,22 +95,22 @@ func (s *OutputReadUpdateConsumer) onMessage(ctx context.Context, msgs []*nats.M
|
||||||
log.Tracef("Received read update from sync API: %#v", read)
|
log.Tracef("Received read update from sync API: %#v", read)
|
||||||
|
|
||||||
if read.Read > 0 {
|
if read.Read > 0 {
|
||||||
updated, err := s.db.SetNotificationsRead(ctx, localpart, roomID, int64(read.Read), true)
|
/*updated*/ _, err := s.db.SetNotificationsRead(ctx, localpart, roomID, int64(read.Read), true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("userapi EDU consumer")
|
log.WithError(err).Error("userapi EDU consumer")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if updated {
|
// if updated {
|
||||||
if err = s.syncProducer.GetAndSendNotificationData(ctx, userID, roomID); err != nil {
|
if err = s.syncProducer.GetAndSendNotificationData(ctx, userID, roomID); err != nil {
|
||||||
log.WithError(err).Error("userapi EDU consumer: GetAndSendNotificationData failed")
|
log.WithError(err).Error("userapi EDU consumer: GetAndSendNotificationData failed")
|
||||||
return false
|
return false
|
||||||
}
|
|
||||||
if err = util.NotifyUserCountsAsync(ctx, s.pgClient, localpart, s.db); err != nil {
|
|
||||||
log.WithError(err).Error("userapi EDU consumer: NotifyUserCounts failed")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if err = util.NotifyUserCountsAsync(ctx, s.pgClient, localpart, s.db); err != nil {
|
||||||
|
log.WithError(err).Error("userapi EDU consumer: NotifyUserCounts failed")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if read.FullyRead > 0 {
|
if read.FullyRead > 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue