diff options
Diffstat (limited to 'src/services/callback.py')
-rw-r--r-- | src/services/callback.py | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/services/callback.py b/src/services/callback.py index 5dc3149..60383d6 100644 --- a/src/services/callback.py +++ b/src/services/callback.py @@ -1,6 +1,26 @@ -class Callback: +from config import user_config +import src.lib as lib + + +class Callbacks: + def __init__(self, object): + self._object = object + + def run_callbacks(self): + self._moderate() + self._deliver_notification() + + return self._object + def _moderate(self): - pass + if self._moderation_setting == 'strict': + self._object.approved = False + return + + if lib.contains_forbidden_term(self._object.content): + if user_config['Env']['blacklist_match_action'] == 'reject': + self._object.approved = False - def deliver_notification(self): + # TODO: Email notifications. + def _deliver_notification(self): pass |