summaryrefslogtreecommitdiff
path: root/src/events.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-05-20 13:43:53 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-05-20 13:43:53 +0200
commit65c2d3dc8891eae4307375eef4b79d13ac793e46 (patch)
tree98359af6c6d9809585b52dcc1aadf083fa590412 /src/events.py
parent0f0efb7ada6ad60f88360bc6a8feb3607fcabd3c (diff)
parent51c788ad96703d215942499ffefe6fdc98326b6b (diff)
downloadpoezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.gz
poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.bz2
poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.xz
poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.zip
Merge branch 'master' of https://git.louiz.org/poezio
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)