Throttles preferences hrefs

The user will not be allowed to trigger a click on a preferences href until their previous one has finished.

rshoe is using it spam us.

I know somebody was talking about trying to do a more proper fix, such as by making it not re-generate these when it's the same, so i'll test merge this until 24 hours or they make such a pr.
This commit is contained in:
Kyle Spier-Swenson
2017-01-08 06:58:56 -08:00
committed by GitHub
parent 6ac0b1a1d0
commit db27bb7727
+7 -1
View File
@@ -19,6 +19,7 @@
If you have any questions about this stuff feel free to ask. ~Carn
*/
/client/Topic(href, href_list, hsrc)
var/static/inprefs = FALSE
if(!usr || usr != mob) //stops us calling Topic for somebody else's client. Also helps prevent usr=null
return
// asset_cache
@@ -45,7 +46,12 @@
if("usr")
hsrc = mob
if("prefs")
return prefs.process_link(usr,href_list)
if (inprefs)
return
inprefs = TRUE
. = prefs.process_link(usr,href_list)
inprefs = FALSE
return
if("vars")
return view_var_Topic(href,href_list,hsrc)