]> jfr.im git - erebus.git/commitdiff
urls - allow to block channels in config
authorJohn Runyon <redacted>
Mon, 4 Sep 2023 02:22:57 +0000 (20:22 -0600)
committerJohn Runyon <redacted>
Mon, 4 Sep 2023 02:22:57 +0000 (20:22 -0600)
modules/urls.py

index f2df04f377bce3d204505c62b0eb7146d1e11c7d..6e99530468a635cbe755e719540365ee5bbb852b 100644 (file)
@@ -77,6 +77,9 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
                result.status = code
                return result
 
+def _get_blocked_chans():
+       return lib.parent.cfg.get('urls', 'blocked', '').split(',')
+
 def process_line(line):
        responses = []
        num_found = 0
@@ -101,6 +104,8 @@ def privmsg_hook(bot, textline):
        user = parser_hostmask(textline[1:textline.find(' ')])
        chan = textline.split()[2]
 
+       if chan in _get_blocked_chans(): return
+
        try:
                line = textline.split(None, 3)[3][1:]
        except IndexError: