[RCD] Need 2 hooks and small patch for auto refresh virtual mailbox

Sergey Sidlyarenko roundcube at lefoyer.ru
Tue Jun 11 08:05:07 CEST 2013


trac.roundcube.net not worked!!! After add this Feature patch return 
message: Submission rejected as potential spam Content contained these 
blacklisted patterns: 'MESSAGE'




I am use dovecot virtual mailbox \All, i am write plugin for auto 
refresh this box if changes in real boxes, but need small patch in core.

{{{
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 1a687f5..4bedae3 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -539,7 +539,7 @@ function rcmail_get_mailbox_name_text()
  }


-function rcmail_send_unread_count($mbox_name, $force=false, 
$count=null, $mark='')
+function rcmail_send_unread_count($mbox_name, $force=false, 
$count=null, $mark='', $parent=false)
  {
    global $RCMAIL;

@@ -551,7 +551,7 @@ function rcmail_send_unread_count($mbox_name, 
$force=false, $count=null, $mark='
      $unseen = $count;

    if ($unseen != $old_unseen || ($mbox_name == 'INBOX'))
-    $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen,
+    $RCMAIL->output->command(($parent ? 'parent.' : ''). 
'set_unread_count', $mbox_name, $unseen,
        ($mbox_name == 'INBOX'), $unseen && $mark ? $mark : '');

    rcmail_set_unseen_count($mbox_name, $unseen);
diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc
index dfc892e..7c22ad2 100644
--- a/program/steps/mail/mark.inc
+++ b/program/steps/mail/mark.inc
@@ -130,4 +130,6 @@ else {
      $OUTPUT->show_message('internalerror', 'error');
  }

+$RCMAIL->plugins->exec_hook('mark_success', array());
+
  $OUTPUT->send();
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index d8d4372..48b13e1 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -305,14 +305,6 @@ $OUTPUT->add_handlers(array(
  ));


-if ($RCMAIL->action == 'print' && 
$OUTPUT->template_exists('messageprint'))
-  $OUTPUT->send('messageprint', false);
-else if ($RCMAIL->action == 'preview' && 
$OUTPUT->template_exists('messagepreview'))
-  $OUTPUT->send('messagepreview', false);
-else
-  $OUTPUT->send('message', false);
-
-
  // mark message as read
  if ($MESSAGE && $MESSAGE->headers && 
empty($MESSAGE->headers->flags['SEEN']) &&
    ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && 
intval($CONFIG['preview_pane_mark_read']) == 0)))
@@ -324,5 +316,15 @@ if ($MESSAGE && $MESSAGE->headers && 
empty($MESSAGE->headers->flags['SEEN']) &&
    }
  }

+$RCMAIL->plugins->exec_hook('show_success', array());
+
+if ($RCMAIL->action == 'print' && 
$OUTPUT->template_exists('messageprint'))
+  $OUTPUT->send('messageprint', false);
+else if ($RCMAIL->action == 'preview' && 
$OUTPUT->template_exists('messagepreview'))
+  $OUTPUT->send('messagepreview', false);
+else
+  $OUTPUT->send('message', false);
+
+
  exit;
}}}




More information about the dev mailing list