Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-subreddit responses #5

Open
Tjstretchalot opened this issue Oct 19, 2017 · 0 comments
Open

Per-subreddit responses #5

Tjstretchalot opened this issue Oct 19, 2017 · 0 comments

Comments

@Tjstretchalot
Copy link
Owner

Tjstretchalot commented Oct 19, 2017

I think it should be an option for subreddits to modify their responses where relevant (ban reason, ban message, modmail pm title, modmail pm message so far).

I think the best way to do this would be:

A new table that describes a "style" of response, ie.

response_types: id, str_id
example row: 1, "propagated_ban_message"

And new table that maps monitored subreddit+response_types pairs to responses

monsub_responses_lookup: id, mon_sub_id, response_type_id, response_id

Then finally, remove the name column from responses. Where before there would be something like

db.getResponseMapping().fetchByName("propagated_ban_modmail_title")

it would become

db.getResponseMapping().fetchByID(
    db.getMonitoredSubredditResponsesLookup().fetchByMonitoredSubredditAndResponseType(
        monitoredSubreddit.id,
        db.getResponseTypeMapping().fetchIDByStringID("propagated_ban_modmail_title")
    )
)

Though that would be wrapped in a function so it's not so obtuse. Perhaps even one in ResponseMapping that does that works just like fetchByName except adds the monitored subreddit part. Not ideologically pretty since it references 2 other tables but this action is done enough that I think the convenience might be worth it

The actual creation/deletion/updating of this would be handled on the website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant