summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfot.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/fot.py b/fot.py
index 01f91d6..28ffdff 100755
--- a/fot.py
+++ b/fot.py
@@ -94,8 +94,8 @@ class Bot(irc.IRCClient):
channel_list = config.get(self.factory.server, 'channels').split()
self.module_channels = dict([(x, []) for x in channel_list])
for m in modules.keys():
- if config.has_option('module/' + m, 'filter'):
- mod_re = re.compile(config.get('module/' + m, 'filter'))
+ if config.has_option('module/' + m, 'filter_channel'):
+ mod_re = re.compile(config.get('module/' + m, 'filter_channel'))
else:
mod_re = None
@@ -127,6 +127,12 @@ class Bot(irc.IRCClient):
for mod in self.msg_callbacks:
if priv or mod in self.module_channels[channel]:
+ # This is a somewhat hackish way to get the module name.
+ mod_name = mod.__module__.split('.')[-1]
+ if config.has_option('module/' + mod_name, 'filter_nick'):
+ filter_re = re.compile(config.get('module/' + mod_name, 'filter_nick'))
+ if not filter_re.match(nick):
+ continue
try:
mod.privmsg(nick, channel, msg)
except: