Commit 574904a5 authored by Simon Esposito's avatar Simon Esposito
Browse files

Minor fix

parent 3b339e2c
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa
	}

	// Deliver live notifications to connected users.
	go func() {
	for userID, ns := range notifications {
		messageRouter.SendToStream(logger, PresenceStream{Mode: StreamModeNotifications, Subject: userID}, &rtapi.Envelope{
			Message: &rtapi.Envelope_Notifications{
@@ -80,7 +79,6 @@ func NotificationSend(ctx context.Context, logger *zap.Logger, db *sql.DB, messa
			},
		}, true)
	}
	}()

	return nil
}
@@ -196,7 +194,7 @@ func NotificationList(ctx context.Context, logger *zap.Logger, db *sql.DB, userI
	cursorQuery := " "
	if nc != nil && nc.NotificationID != nil {
		cursorQuery = " AND (user_id, create_time, id) > ($1::UUID, $3::TIMESTAMPTZ, $4::UUID)"
		params = append(params, &pgtype.Timestamptz{Time: time.Unix(0, nc.CreateTime).UTC(), Valid: true}, uuid.FromBytesOrNil(nc.NotificationID))
		params = append(params, time.Unix(0, nc.CreateTime).UTC(), uuid.FromBytesOrNil(nc.NotificationID))
	}

	rows, err := db.QueryContext(ctx, `