thomascube
2009-07-31 330ef6ca44df4111d6f6b33ba0684e865ba8c30e
Create plugin hook for encrypted message parts + add size property to text part in order to display it

1 files modified
8 ■■■■■ changed files
program/include/rcube_message.php 8 ●●●●● patch | view | raw | blame | history
program/include/rcube_message.php
@@ -323,9 +323,17 @@
      $p->ctype_primary = 'text';
      $p->ctype_secondary = 'plain';
      $p->body = rcube_label('encryptedmessage');
      $p->size = strlen($p->body);
      
      // maybe some plugins are able to decode this encrypted message part
      $data = $this->app->plugins->exec_hook('message_part_encrypted', array('object' => $this, 'struct' => $structure, 'part' => $p));
      if (is_array($data['parts'])) {
        $this->parts = array_merge($this->parts, $data['parts']);
      }
      else if ($data['part']) {
      $this->parts[] = $p;
    }
    }
    // message contains multiple parts
    else if (is_array($structure->parts) && !empty($structure->parts)) {
      // iterate over parts