From 5f4a5eeee5c0909b5960744e0683bd0a9f15a08c Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Wed, 11 Dec 2013 11:48:44 +0100 Subject: [PATCH] Few fixes. --- doc/extending/events.rst | 4 +++- doc/index.rst | 11 ----------- .../extensions/webmail/static/webmail/js/webmail.js | 5 ++--- modoboa/lib/events.py | 4 ++-- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/doc/extending/events.rst b/doc/extending/events.rst index 8ffa83b55..2741bd421 100644 --- a/doc/extending/events.rst +++ b/doc/extending/events.rst @@ -629,8 +629,10 @@ template but need javascript stuff. *Callback prototype*:: - def callback(user): pass + def callback(caller, user): pass +* ``caller`` is name of the application (or the location) responsible + for the call * ``user`` is a ``User`` instance corresponding to the currently logged in user diff --git a/doc/index.rst b/doc/index.rst index f4467b5e4..f6024fb06 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -6,8 +6,6 @@ Modoboa's documentation! ======================== -This documentation refers to version |release|. - *************** Getting started *************** @@ -49,12 +47,3 @@ Additional resource additional/migrating additional/virtualmachine - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js index a4e3c3240..5e5a893a4 100644 --- a/modoboa/extensions/webmail/static/webmail/js/webmail.js +++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js @@ -726,9 +726,8 @@ Webmail.prototype = { $("body").notify("success", gettext("Message sent"), 2000); }, this)).fail($.proxy(function(jqxhr) { var data = $.parseJSON(jqxhr.responseText); - this.navobject.get_callback("compose")(data); - if (data.respmsg != undefined) { - $("body").notify("error", data.respmsg); + if (data != undefined) { + $("body").notify("error", data); } $("a[name=sendmail]").attr("disabled", null); }, this)); diff --git a/modoboa/lib/events.py b/modoboa/lib/events.py index e5baac544..cd574b412 100644 --- a/modoboa/lib/events.py +++ b/modoboa/lib/events.py @@ -139,7 +139,7 @@ def raiseEvent(event, *args, **kwargs): :param event: the event to raise """ - if not event in events or not event in callbacks.keys(): + if not event in events or not event in callbacks: return 0 for callback in callbacks[event].values(): callback(*args, **kwargs) @@ -155,7 +155,7 @@ def raiseQueryEvent(event, *args, **kwargs): :param event: the event to raise """ result = [] - if not event in events or not event in callbacks.keys(): + if not event in events or not event in callbacks: return result for callback in callbacks[event].values(): tmp = callback(*args, **kwargs)