<p></p>
<p><b>@gravitystorm</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4202#discussion_r1310045709">app/models/user.rb</a>:</p>
<pre style='color:#555'>> @@ -395,6 +395,19 @@ def max_friends_per_hour
     max_friends.clamp(0, Settings.max_friends_per_hour)
   end
 
+  def max_changeset_comments_per_hour
+    if moderator?
+      36000
+    else
+      previous_comments = changeset_comments.limit(200).count
+      active_reports = issues.with_status(:open).sum(:reports_count)
+      max_comments = previous_comments / 200.0 * Settings.max_changeset_comments_per_hour
+      max_comments = max_comments.floor.clamp(Settings.min_changeset_comments_per_hour, Settings.max_changeset_comments_per_hour)
+      max_comments /= 2**active_reports
+      max_comments.floor.clamp(1, Settings.max_changeset_comments_per_hour)
+    end
</pre>
<blockquote>
<p dir="auto">Obviously there is a potential issue with non-moderator power users as you say, though to paraphrase <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/woodpeck/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/woodpeck">@woodpeck</a> do we really want those people commenting on thousands of changesets and generating email storms?</p>
</blockquote>
<p dir="auto">😄 Although if good stuff can be done outside of DWG, more power to them! But in this case, a power user can be prevented from making more than <code class="notranslate">1</code> changeset comment per hour, by only a few (bogus) reports.</p>
<p dir="auto">For naming, my suggestion would be:</p>
<ul dir="auto">
<li><code class="notranslate">min_changeset_comments_per_hour</code> = 1</li>
<li><code class="notranslate">default_changeset_comments_per_hour</code> = 6</li>
<li><code class="notranslate">max_changeset_comments_per_hour</code> = 200</li>
<li><code class="notranslate">moderator_changeset_comments_per_hour</code> = 36_000</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4202#discussion_r1310045709">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLFS6O5V4NTAVKZR6TXX4H7BANCNFSM6AAAAAA363PXKA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLBWGWH76FDPWW5XW3XX4H7BA5CNFSM6AAAAAA363PXKCWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTS7QJ3LY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4202/review/1602385596</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4202#discussion_r1310045709",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4202#discussion_r1310045709",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>