saidit
saidit copied to clipboard
Explore possibility of using native suspension
Hey there,
I was wondering if you might explore using Reddit's native suspension feature in Saidit.
The main benefits I would see from a switch are that buttons don't disappear (as they do when a user is globally banned) and that it is better in UX terms (i.e. a large banner is shown to the user while logged in). There may be other benefits, search for in_timeout
for a better list.
You can emulate a "native" permanent suspension by doing the following:
(run reddit-shell
in src/reddit/r2 or equivalent location)
from r2.models import Account
u = Account._by_name ('yourusername')
u.in_timeout = True
u.days_remaining_in_timeout = 0
u._commit ()
where yourusername is a user you want to test it on.
I am not sure how to issue a "native" temporary suspension, but it appears that TempTimeout
in the code has those capabilities, if you figure out how to use your custom code as a wrapper around it.
Thanks,
sau226
Thanks sau, great ideas. Utilizing what reddit had in place for bans would certainly be a better implementation. I'll explore it sometime.
u.days_remaining_in_timeout = 0
isn't necessary, it's the default. As a matter of fact you can't set it directly, because it's a getter method. If you want a suspension to be temporary you have to use TempTimeout.schedule()
. Weird way to do it, probably slower too since it uses a separate lookup table. And also buggy, because if the program that lifts suspensions at the end of its duration fails it becomes a permanent suspension. I have no idea why someone would design it that way.