Post moderation

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post moderation
« Reply #15, on January 13th, 2012, 01:02 PM »
OK, so I thought about this a bit more today, going to look at implementing some of it hopefully today as well.

The bit I thought about was the criteria tag. It occurred to me that you might not just want to moderate posts but blacklist some types of content too depending on other criteria.

Specifically turning it into something like:
<criteria for="moderate"> - if the criteria are met, moderate the post/topic

<criteria for="prevent"> - if the criteria are met, prevent the post from being made entirely

<criteria for="lock"> - automatically lock the topic if certain criteria are applied (e.g. post contains ^/lock AND user has permission to lock topic)

Just a thought, anyways.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post moderation
« Reply #16, on January 13th, 2012, 02:15 PM »
I can already smell the 'feature that will take weeks to develop'...

At this point, I'd be tempted to say, "postpone for Wedge 1.1"..?
Re: Post moderation
« Reply #17, on January 15th, 2012, 11:19 PM »
One thing that might be a good idea... How about showing, in the main menu (Admin section), the number of reported posts waiting to be read? And the number of posts and files requiring approval...
I don't think they're cached and accessible at any moment, though, so that would be the main thing to fix... Filling in this data.
Then, if we have 5 errors in the log, 3 posts waiting for moderation and 1 post waiting for approval, we could update the top-level admin number to 9 instead of 5. I think it would make a lot of sense... "9 events requiring your attention"...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post moderation
« Reply #18, on January 15th, 2012, 11:59 PM »
Quote
One thing that might be a good idea... How about showing, in the main menu (Admin section), the number of reported posts waiting to be read? And the number of posts and files requiring approval...
Well, the number of posts is already shown in the header, but moving it to the menu would be good (provided that we totalled up all the notices and listed that x are error log, y are moderation items... etc)

As for number of things requiring approval, these are actually not cumulatively tracked, only on a per-board basis (in the board/topic themselves IIRC) and that would otherwise entail a query to get that. Thing is, you can't just have a site-wide count because it won't always be site-wide. Not all sites have all their boards open to all staff, and a moderated post in a very private board wouldn't necessarily be available to more regular moderators.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post moderation
« Reply #19, on January 16th, 2012, 08:32 AM »
I know it's not going to be site-wide, but I was thinking, for admins and global mods, they're always going to have the same numbers, aren't they..?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post moderation
« Reply #20, on January 16th, 2012, 08:35 AM »
Admins, yes, global mods... maybe. Global mods don't have to be global, it's only implied, not enforced. They are by default, but beyond that, no guarantee.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post moderation
« Reply #21, on January 16th, 2012, 11:47 AM »
I just think that there should be an incentive for people to check the moderation area, in case they never do... Even if it's only the admin, it's already that.

billy2

  • Trying to earn brownie points for a lads trip to the Red Sea. Minus 1 already - just for asking!!
  • Posts: 350
Re: Post moderation
« Reply #22, on January 16th, 2012, 09:00 PM »
Quote from Nao on January 16th, 2012, 11:47 AM
I just think that there should be an incentive for people to check the moderation area, in case they never do... Even if it's only the admin, it's already that.
+1
<br /><br />cough, cough.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post moderation
« Reply #23, on February 9th, 2012, 10:27 AM »
OK, so I took a crack at this last night and I debugged what was left this morning.

So right now I have the foundations in place - it's the UI that's missing. I created a temporary textbox in the admin panel and used that to indicate rules in the XML.

It's possible to construct rules on the following criteria: (and to have separate criteria for new posts vs new topics)
* in a given board or boards, or outside of given board or boards (e.g. able to say 'inside boards 1, 2 or 3' or 'all boards except board 4')
* user is or is not given id (e.g. do something if it is user id 1, do something if it is not user id 1)
* postcount is above/below a certain level (e.g. do something if count < 10, or count >= 20)
* warning level is above/below a certain level (e.g. do something if warning <= 10 or > 60)
* subject or body contain a given arbitrary regex (e.g. you can do something if a post contains profanity)
* user is in, or not in, certain groups (e.g. user is part of group 1 or not part of group 1)
* user has a given permission, or doesn't (e.g. do something if user has ability to lock any topic)

That last one is quite important as quite a few different tasks as available to be carried out.

* prevent the post being made at all (throws it back to the post editing screen with a warning about containing words that are not permitted; the warning itself is not actually specific to the content refused)
* place the post in moderation
* lock/unlock the topic
* pin/unpin the topic

To put it into context, you can specify - for example, that if the post contains ^/lock and the user has permission to lock any topic, that it will be locked automatically.

Rules are thus cumulative - a given rule can happily test for multiple criteria before acting. You can - as I tested this morning, for example - create a rule whereby if a non-admin posts the word 'fuck', the post is disallowed entirely - but the admin is free to post this happily.

IOW, all of the underlying behaviour set out in this topic is implemented and - thus far - seems to be working, though there's no UI (which has other stuff that needs to be managed where replacing the older setup)

Known caveats/issues:
* There's no logic for handling own vs any permissions at this point, and I'm not really sure it needs it - replying to own vs any is already a physical permission that's handled normally, it's mostly for the lock topic stuff and I'd argue if you're locking a topic based on something the user can do or not do, you probably shouldn't be giving it to everyone anyway.
* Can't yet handle based on number of replies (e.g. when 200 replies are in a topic, lock it)
* It's not possible to return a non-generic error on going back to the user.
* It's also not possible to do something like warn a user (but I'd argue that unless the post is going directly to moderation and nowhere else, the user probably shouldn't receive a warning)
* The outcome of rules action on a post is not logged at this point in time unless it's an existing moderation action (if you use the lock-topic option for example, the act of locking a topic will become logged but only because the existing code is still used)

It's a WIP from about 4 hours work :)


The one thing that bugs me is what to do about attachments. Right now the system just hijacks the original moderation, it doesn't deal with any of the permissions and it very definitely doesn't care about attachments (they would fall into the original code which is, make them unapproved unless they have permission to post attachments without worrying about approval) - but I'm honestly wondering whether it's actually an issue or not.

Do we actually care about attachments requiring approval? I'd argue that it should be tied to the post's approval status rather than the attachment itself being approved.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post moderation
« Reply #24, on February 10th, 2012, 02:33 PM »
Quote from Arantor on February 9th, 2012, 10:27 AM
Do we actually care about attachments requiring approval? I'd argue that it should be tied to the post's approval status rather than the attachment itself being approved.
As implied in another topic -- my official word on this is that I don't give a damn about attachment approval, and I agree with you. At 'worst', you can always add a rule saying 'if post has an attachment...'. Maybe even extra rules like 'attachment over X bytes', 'attached image over X pixels' or 'attachment that is of the image/doc/zip type'.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post moderation
« Reply #25, on February 10th, 2012, 02:34 PM »
Quote
At 'worst', you can always add a rule saying 'if post has an attachment...'. Maybe even extra rules like 'attachment over X bytes', 'attached image over X pixels' or 'attachment that is of the image/doc/zip type'.
I actually hadn't thought of that, but it could be an interesting extra rule type.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post moderation
« Reply #26, on February 10th, 2012, 03:15 PM »
:)

Problem solved, then!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post moderation
« Reply #27, on February 10th, 2012, 03:23 PM »
Well, I'm currently in the middle of stripping out attachment approval stuff, and while I'm not sure we need the 'post has attachments' rules at this stage, I'll certainly bear them in mind for later :)
Re: Post moderation
« Reply #28, on February 10th, 2012, 04:05 PM »
Egad... now I realise the full horror of some of the internals.

The permissions I need to think about, because the permissions as set up can actually tell a user *before they try to post* that the post will be moderated. Need to figure out if there's a way I can quickly derive a subset that will be able to warn users ahead of schedule.

Meanwhile... {db_prefix}approval_queue is going to need some surgery, especially since it still actually has a calendar field in it >_<

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Post moderation
« Reply #29, on June 15th, 2012, 09:03 AM »
Re: the message just above... (Which I missed originally. It was unread --- there are some topics I keep for later and then they drop out of the 20 latest topics and I completely forget about them...)

I was working on fixing the post_thought permission to work 'as intended' with user warnings (as opposed to the odd hack I committed by mistake), and then found about user moderation (high warning level.) It applies post_unapproved_topics and such to them, which I think is exactly relevant to what you mentioned above.

So, yeah, I was already thinking that associating post moderation to moderation filters, while a notably good concept in your mind, wasn't going to cut it because I wanted to be able to post-moderate a message (i.e. make it unapproved even though it was already approved, for instance as a replacement to deletion, or simply as a way for multiple negative reports to hide it until a moderator decides it's okay and should be protected against reports or something) (yeah I know, it's a feature suggestion and I'm not going to do it... -_-), anyway, I was already thinking that, and now it's even more obvious to me -- post moderation should be *always* enabled on any topic that has at least one unapproved post (i.e. topics should have a 'post_moderation' field set to 1), and technically speaking, everywhere we access multiple topics in a single query (either by looking for a post_moderation setting, or just enabling unapproved post tests by default.)

Discuss. (<-- I feel at school all over again...)