you are viewing a single comment's thread.

view the rest of the comments →

[–]Vulptex 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (7 children)

I've dealt with this on reddit before, you'd be surprised how many of them don't check for shadowbans. Just make 100% sure they're not real users before you do it, and remember, mods can still approve their posts if it was a mistake.

You shouldn't need to program it yourself, the functionality comes with reddit. If you set a user's _spam flag, they will be shadowbanned. I think you'll have to fix the votes, but that's it unless saidit's changes broke something else too. Alternatively you could make one that only shadowbans votes.

There's also is_suspended but you already have a replacement for that, and _banned which I would never use if possible, that's the one that logs the user out of their account and blocks their password. For shadowbans there's also a flag that keeps their profile page visible.

A script could auto-ban accounts from a certain IP, but it sounds like that's not going to work here, and it's not really the greatest thing to go by anyway. A cookie might work for some cases, but probably not this one.

In the case of real users I think an automated message explaining their ban would be a good idea, I got it working without much trouble.

[–]magnora7 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (6 children)

Actually I don't think we inherited any of that functionality unfortunately. They stripped out all the admin controls from the open source. D3rr had to make a new ban system from scratch basically when we first started. Unless you're talking about some mod-level functionality I'm unaware of, I don't think we have it.

I would be down with an automated message to the person banned. But on the other hand maybe it's good sometimes if they don't know they're banned, similar to shadowbanning. Saidit currently doesn't explicitly say "you're banned", I believe it just returns errors when the banned user tries to post or comment something. Which I think is a reasonable system.

[–]Vulptex 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (2 children)

Oh shit! There was no need to make a whole new ban system. They only stripped out the frontend. The functionality is still there, you just have to make a button to enable it (or don't, it may be a good idea for only you to be able to perform shadowbans). I know these things because I've tested it out myself. If you look through the source code you can see the _spam and is_suspended attributes, and they do work. u/d3rr I feel bad for you now.

Make a test account and use the console to set its _spam attribute, then post stuff with it and play around with mod tools (spoiler: most of them don't work), then try is_suspended and maybe _banned.

I have tested the global ban on saidit and it does not send a message, but it does remove the post and comment buttons like a subreddit ban. I think it would be helpful for real users to know why they were banned.

[–]magnora7 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (1 child)

I'm sure d3rr just built a new frontend if that's all that was necessary. I didn't work on this portion of it so I don't know the details, only d3rr does, but he deleted his saidit account so tagging him is especially pointless.

If you can figure out how to code the sending of an automated message upon banning that might be good, but I still think that maybe the extra of delay of shills and bots having to figure out they are banned might be worth it, especially if you were previously suggesting shadowbanning...

[–]Vulptex 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

It's a completely different backend. u/d3rr was apparently unaware that the backend for admin tools was included, so he rolled his own quick one. But if you need someone shadowbanned, use the console to set their _spam flag. Since they're separate functions a message would not be sent for shadowbans, but would for normal bans (or suspensions, if you want to switch to that). Iirc you have to program the system account to send a PM automatically when a ban or suspension is fired.

I do think suspensions might work as a replacement for users who became unbannable after the 500 error happened when attempting to global ban them, which seems to be getting more common.

If I have time I can make some changes myself and test them, assuming the github is up to date. I could add a frontend for shadowbans and suspensions. I'm guessing the reddit admins have a completely separate program from reddit that they use to take these actions.

[–]Vulptex 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

Actually it's in_timeout, not is_suspended. That might be ruqqus.

Anyway you can see the in_timeout property here: https://github.com/libertysoft3/saidit/blob/master/r2/r2/models/account.py

The _spam attribute comes from a superclass and is the same as what's used for sub bans, and I think posts and comments and messages too.

[–]Vulptex 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

[–]Vulptex 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

u/d3rr I saw this line:

# TODO: refactor to self._spam
if self.is_global_banned:

Accounts already have a _spam property, it's inherited, I think from thing, along with _deleted. Enabling it causes the user to be shadowbanned.

The code for "chucking" an account (password lockout) with the _banned property starts on line 556.

In listingcontroller.py, at line 952, you can see where the profile pages are blocked for _spam, _deleted, and in_timeout. Here's the shadowban one:

# hide spammers profile pages
if vuser._spam and not vuser.banned_profile_visible:
    if (not c.user_is_loggedin or
            not (c.user._id == vuser._id or
                 c.user_is_admin or
                 c.user_is_sponsor and where == "promoted")):
        return self.abort404()