summaryrefslogtreecommitdiff
path: root/src/events.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-05-12 20:44:38 +0200
committermathieui <mathieui@mathieui.net>2012-05-12 20:44:38 +0200
commit28c15a889e006769d343e729b55de66df3a00526 (patch)
treec25392700839977a56b8800af654ab914ddbac39 /src/events.py
parent0c6a0abe8609b870570a623348b4deb62a89cd6f (diff)
downloadpoezio-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.py6
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)