uses code from the other PR i have open, so merge that one first (might be conflicts, lmk)
you'll need to do an auto migration
changes:
frontend/backend for changing the auto-approve setting
endpoints to click from email signature that turn moderation on/off for a sender+thread pair
threadhash logic, if auto-approve setting is on:
we store a hash of sender|subject along with foreign key to the related group and a boolean indicating whether the owner has specifically opted in to continue moderation for this user
when we get a post from a user, we see if threadhash for them exists
if it does and moderate=True, post needs moderation (user opted in)
if it does and moderate=False, auto-approve post (this is not their first post, and first one was approved)
if it doesn't, then post goes through moderation and (if approved) threadhash will be created and stored upon approval
better logic for emailing mods
when we get a new email find the least recently emailed moderator, and if we haven't emailed them in last 24 hrs, send them a notification and update last emailed time
todo: should probably have cron job or similar that resends the notification after 24 hrs if the emails haven't been dealt with yet
if a squad has no moderators, then automatically approve emails received, and send to owner with a link to add mods
uses code from the other PR i have open, so merge that one first (might be conflicts, lmk)
you'll need to do an auto migration
changes: