summaryrefslogtreecommitdiff
path: root/plugins/kolab_notes
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-26 10:33:37 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-26 10:33:37 (GMT)
commit44bf23bbc1d5fae1234f11209058169fea751662 (patch)
tree0f940fe8fe81429ce73fcf57dbb8e948d1757f7a /plugins/kolab_notes
parent68b7e05fa35e6818b234334997cc8f7635530b5c (diff)
downloadroundcubemail-plugins-kolab-44bf23bbc1d5fae1234f11209058169fea751662.tar.gz
Avoid endless recursion when loading kolab config objects (also triggers 'mail_message_load' hook)
Diffstat (limited to 'plugins/kolab_notes')
-rw-r--r--plugins/kolab_notes/kolab_notes.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/kolab_notes/kolab_notes.php b/plugins/kolab_notes/kolab_notes.php
index a5723a1..28ad6c9 100644
--- a/plugins/kolab_notes/kolab_notes.php
+++ b/plugins/kolab_notes/kolab_notes.php
@@ -81,9 +81,12 @@ class kolab_notes extends rcube_plugin
}
else if ($args['task'] == 'mail') {
$this->add_hook('storage_init', array($this, 'storage_init'));
- $this->add_hook('message_load', array($this, 'mail_message_load'));
$this->add_hook('message_compose', array($this, 'mail_message_compose'));
- $this->add_hook('template_object_messagebody', array($this, 'mail_messagebody_html'));
+
+ if ($args['action'] == 'show' || $args['action'] == 'preview') {
+ $this->add_hook('message_load', array($this, 'mail_message_load'));
+ $this->add_hook('template_object_messagebody', array($this, 'mail_messagebody_html'));
+ }
// add 'Append note' item to message menu
if ($this->api->output->type == 'html' && $_REQUEST['_rel'] != 'note') {
@@ -906,8 +909,9 @@ class kolab_notes extends rcube_plugin
*/
public function mail_message_load($p)
{
- $this->message = $p['object'];
- $this->message_notes = $this->get_message_notes($this->message->headers, $this->message->folder);
+ if (!$p['object']->headers->others['x-kolab-type']) {
+ $this->message_notes = $this->get_message_notes($p['object']->headers, $p['object']->folder);
+ }
}
/**