Do not set rate visitor for non-eligible topics

This commit is contained in:
binwiederhier 2024-05-07 21:17:51 -04:00
parent 31d0c812ce
commit 030f7266f7
3 changed files with 21 additions and 1 deletions

View file

@ -1499,6 +1499,9 @@ func (s *Server) maybeSetRateVisitors(r *http.Request, v *visitor, topics []*top
// - topic is not reserved, and v.user has write access
writableRateTopics := make([]*topic, 0)
for _, t := range topics {
if !util.Contains(eligibleRateTopics, t) {
continue
}
ownerUserID, err := s.userManager.ReservationOwner(t.ID)
if err != nil {
return err