All this needs to be done is duplicate the validator with the name to be "VByNameIfCanEdit", and in this duplicated validator replace L897 TO
if c.user_is_logged_in and thing.author_id == c.user._id:
return thing
elif thing.author_id == Account.automoderator_account()._id:
sr = Subreddit._byID(thing.sr_id)
if sr.is_moderator_with_perms(c.user, "posts"):
return thing
So; it's alot easier than people expect. Of course, the same logic would have to be applied for how the edit button shows up which is similarly simple, and the admins may want to add a small check to make the note say "edited by mod <mod username>". But that's also a simple logical check.
that they'd need to check in the edit controller to ensure that the " I am a bot" text stays, but that's also simple enough.
Maybe enforce a process lock if it's an automod item, since this introduces the (possibly high based on mod amount) problem of more than one person editing at once. But that also should be simple, e.g. with g.make_lock() as l: # if the comment is currently being edited, wait until that lock is released. I'd be more detailed but I'm on mobile and my fingers hurt.
E3: Well it was more complicated than I thought because I forgot about the front end changes, but, #1502
I like this solution quite a bit. It would allow teams to move away from having their own bot accounts for scheduled posts (in case said posts could require editing).
While good in theory, and also not so difficult to do, it can make it a little bit more complicated than needed. Personally I find directly editing much simpler to the average mod than "send a message, wait until automod reads and parses it, which could get backed up, and then have it edit itself"
It's true it could get backed up. But, it's possible that the average mod might not understand your method. From reading it, I'm not even sure if you're saying it's technically possible to implement, or if it already is do-able. For people who don't want to deal with code, simple is better.
The mods wouldn't have to deal with the code. I just said the changes the admins would have to make back end for it to work, because I feel as if I'm obligated to put my money where my mouth is ever since an incident a long time ago.
The way it works is literally the same as it currently works if you edit your own stuff. You press the edit button on automod's comment / post, edit as necessary, and press save. The only difference is that automod's disclaimer "I'm a bot, this was automatic" would be forced and the edit asterisk (which pops up when you edit something) will denote which mod edited the thing.
However it takes forever for the admins to review (not that I'm blaming them) and the chances of one being excepted (however much wanted by this community) are low to medium at best.
I agree with /u/appropriate-username and /u/13steinj. Your solution looks good on paper and has a low degree of difficulty from a technical perspective, since AutoMod already does some PM command stuff, BUT it would not be ideal in practice because of how AM is affected by lag from traffic spikes and other server woes. Updating a set of scheduled post instructions with AM can be a pain because AM can straight up miss your update command and never parse the update. Your solution would be vulnerable to the same pitfall.
Yeah, I understand that. I usually have to send 4/5 schedule update messages to get a confirmation (I wonder how much that contributes to the backup?) so my suggestion would probably get annoying.
Hey, so, I accidentally lied because I can't actually submit the PR today. It's all done except I forgot the methodology for loading accounts quickly (in order to load the mod editor for the edit timestamp), so I'll have to submit it tomorrow morning after finding it again. But other than that (and showing the edit button, since I want to push that to my branch after the timestamp loading is done), here. It's slightly different than what I said originally since I wanted to make it work for installs without an automod account and found out a trick to speed up loading the subreddit.
EDIT:See this comment which explains it is actually much easier than though. but my alt solution of using another mod account is still valid.
Yeah this would be REALLY difficult/involved to do, just based on how AutoMod currently functions. AutoMod is a single account, controlled by the admins, and there isn't any way to have another user access any other account, without logging in as that user, and logging in as automod is not a going to happen due to so many things breaking.
It would be easier to use /r/requestabot and either search for a scheduled post bot, have them make one for you, then use a shared mod account to manually post/use the bot to post then you can all edit.
Automod is in no way a "shitty hack". You've said this before also, about how it's pseudo code. That's true. But it's very reasonable and reliable. Personally as an outsider I see no reason to fix something not broken.
Fully understand. Though in my opinion, this would be more suited for the r/toolbox devs (if the admins don't want to do this right now) since this GUI would be fully client side / front end and done in JavaScript
I've seen an automoderator GUI through oauth and an external site mentioned a couple times. It's not coming from the toolbox devs. My logs for that discussion expired though., so I can't say any more details. Sorry about that.
The links are edited to have ?context=10000 or (at least I'm remembering 10000) with JavaScript somewhere else. I'm on mobile so the actual javascript bit is making itself difficult to find. But it's there, somewhere.
But in RES you can set the "default context" of what the number is when you just press context; however; that's extremely tinily broken but in dev semi fixed (https://github.com/honestbleeps/Reddit-Enhancement-Suite/issues/1903) and I was planning on submitting a few additions / fixes this week (including the other half of the fix to this).
14
u/13steinj Jan 08 '16 edited Jan 10 '16
While people are saying this is hard to do...It isn't. Not in the slightest.
See the edit controller. It will edit the
itemin the validation wrapper above if the validator passes.The validator's code is here.
All this needs to be done is duplicate the validator with the name to be "VByNameIfCanEdit", and in this duplicated validator replace L897 TO
So; it's alot easier than people expect. Of course, the same logic would have to be applied for how the edit button shows up which is similarly simple, and the admins may want to add a small check to make the note say "edited by mod <mod username>". But that's also a simple logical check.
Tl;dr Very doable and mostly simple.
E: tagging /u/appropiate-username and /u/D0cR3d
E2: I forgot to mention a few checks:
with g.make_lock() as l: # if the comment is currently being edited, wait until that lock is released. I'd be more detailed but I'm on mobile and my fingers hurt.E3: Well it was more complicated than I thought because I forgot about the front end changes, but, #1502
4
u/13steinj Feb 07 '16
Hey OP. I forgot to make this comment yesterday because I was severely frustrated with something related.
That said, I know many users don't watch the github and in the same sense, the admins haven't responded to this thread.
Unfortunately, the pull request was rejected. Sucks but so it goes.
Tagging users who seemed interested so they can know:
/u/MisterWoodhouse /u/appropriate-username /u/D0cR3d
1
u/D0cR3d Jan 08 '16 edited Jan 08 '16
EDIT: See this comment which explains it is actually much easier than though. but my alt solution of using another mod account is still valid.
Yeah this would be REALLY difficult/involved to do, just based on how AutoMod currently functions. AutoMod is a single account, controlled by the admins, and there isn't any way to have another user access any other account, without logging in as that user, and logging in as automod is not a going to happen due to so many things breaking.
It would be easier to use /r/requestabot and either search for a scheduled post bot, have them make one for you, then use a shared mod account to manually post/use the bot to post then you can all edit.
4
u/[deleted] Jan 08 '16 edited Jan 08 '16
[removed] — view removed comment