diff options
author | mathieui <mathieui@mathieui.net> | 2012-05-12 20:44:38 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-05-12 20:44:38 +0200 |
commit | 28c15a889e006769d343e729b55de66df3a00526 (patch) | |
tree | c25392700839977a56b8800af654ab914ddbac39 /src/events.py | |
parent | 0c6a0abe8609b870570a623348b4deb62a89cd6f (diff) | |
download | poezio-28c15a889e006769d343e729b55de66df3a00526.tar.gz poezio-28c15a889e006769d343e729b55de66df3a00526.tar.bz2 poezio-28c15a889e006769d343e729b55de66df3a00526.tar.xz poezio-28c15a889e006769d343e729b55de66df3a00526.zip |
Add the ignore_private and private_auto_response options
MUC-specific options.
private_auto_response is empty by default.
+ new event ignored_private
Diffstat (limited to 'src/events.py')
-rw-r--r-- | src/events.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/events.py b/src/events.py index 8def6cb0..e66c5ee5 100644 --- a/src/events.py +++ b/src/events.py @@ -40,6 +40,7 @@ class EventHandler(object): 'muc_nickchange': [], 'muc_ban': [], 'send_normal_presence': [], + 'ignored_private': [], } def add_event_handler(self, name, callback, position=0): @@ -63,7 +64,10 @@ class EventHandler(object): """ Call all the callbacks associated to the given event name. """ - callbacks = self.events[name] + callbacks = self.events.get(name, None) + if callbacks is None: + log.debug('%s: No such event.', name) + return for callback in callbacks: callback(*args, **kwargs) |