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:
texuf 2022-09-15 08:25:34 -07:00
parent 4e30e03345
commit af369c34cb

View file

@ -95,13 +95,13 @@ 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
@ -110,7 +110,7 @@ func (s *OutputReadUpdateConsumer) onMessage(ctx context.Context, msgs []*nats.M
log.WithError(err).Error("userapi EDU consumer: NotifyUserCounts failed") log.WithError(err).Error("userapi EDU consumer: NotifyUserCounts failed")
return false return false
} }
} //}
} }
if read.FullyRead > 0 { if read.FullyRead > 0 {