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'))
'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());
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'))
-else if ($RCMAIL->action == 'preview' && $OUTPUT->template_exists('messagepreview'))
-else
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'))
+else if ($RCMAIL->action == 'preview' && $OUTPUT->template_exists('messagepreview'))
+else
}}}
Hi Sergey
I don't get the $parent change in your patch because rcmail_send_unread_count() doesn't seem to be called anywhere with that additional argument. The entire command execution should be solved in the output classes anyways and individual steps should not need to care about that.
Then, I rather suggest to add a general 'request_end' hook that takes 'task' and 'action' arguments (similar to the 'startup' hook) rather than the two hooks 'show_success' and 'mark_success' that you suggested. There's already the 'render_page' hook but that is limited to HTML output only. An equivalent for JSON would also be useful.
~Thomas
On Tue, Jun 11, 2013 at 8:05 AM, Sergey Sidlyarenko roundcube@lefoyer.ru wrote:
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; }}}
Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
And this please.
{{{ diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc index e21ba2c..827cf67 100644 --- a/program/steps/mail/move_del.inc +++ b/program/steps/mail/move_del.inc @@ -146,5 +146,7 @@ else } }
+$RCMAIL->plugins->exec_hook('move_del_success', array());
}}}
Need for this plugin. https://github.com/lefoyer/vmrefresh
Thomas Bruederli писал 2013-06-12 11:28:
Hi Sergey I don't get the $parent change in your patch because rcmail_send_unread_count() doesn't seem to be called anywhere with that additional argument. The entire command execution should be solved in the output classes anyways and individual steps should not need to care about that.
Used in my plugin to add call to parent from frame, for change virtualbox count after preview message with set SEEN flag on message.
Then, I rather suggest to add a general 'request_end' hook that takes 'task' and 'action' arguments (similar to the 'startup' hook) rather than the two hooks 'show_success' and 'mark_success' that you suggested. There's already the 'render_page' hook but that is limited to HTML output only. An equivalent for JSON would also be useful.
I need 3 hook (2 - in json (mark, move_del), 1 - in html (show/preview)), used to update count in virtual mail boxes. I not understand, why need to call my plugin all time at render_page.
On Wed, Jun 12, 2013 at 1:27 PM, Sergey Sidlyarenko roundcube@lefoyer.ru wrote:
And this please.
{{{ diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc index e21ba2c..827cf67 100644 --- a/program/steps/mail/move_del.inc +++ b/program/steps/mail/move_del.inc @@ -146,5 +146,7 @@ else } }
+$RCMAIL->plugins->exec_hook('move_del_success', array());
// send response $OUTPUT->send();
}}}
You obviously didn't understand my proposition. Instead of adding individual hooks for every step, we'd rather want to trigger one single hook at the end of every step specifying the action as a hook argument..
Need for this plugin. https://github.com/lefoyer/vmrefresh
Thomas Bruederli писал 2013-06-12 11:28:
Hi Sergey I don't get the $parent change in your patch because rcmail_send_unread_count() doesn't seem to be called anywhere with that additional argument. The entire command execution should be solved in the output classes anyways and individual steps should not need to care about that.
Used in my plugin to add call to parent from frame, for change virtualbox count after preview message with set SEEN flag on message.
That change should not be necessary. $RCMAIL->output->command() should pass the command to the parent window automatically. If it doesn't for some reason, the command logic should be fixed and not work-arounded like this.
Then, I rather suggest to add a general 'request_end' hook that takes 'task' and 'action' arguments (similar to the 'startup' hook) rather than the two hooks 'show_success' and 'mark_success' that you suggested. There's already the 'render_page' hook but that is limited to HTML output only. An equivalent for JSON would also be useful.
I need 3 hook (2 - in json (mark, move_del), 1 - in html (show/preview)), used to update count in virtual mail boxes. I not understand, why need to call my plugin all time at render_page.
Even with a generic hook you can easily filter the calls that actually should do something in your plugin with if ($args['action'] == 'xxx')
~Thomas
Ok, need one hook after SUCCESS move_del + mark + show/preview & before send (because that need add command before write).
That change should not be necessary. $RCMAIL->output->command() should pass the command to the parent window automatically. If it doesn't for some reason, the command logic should be fixed and not work-arounded like this.
I am test, this no truth.
Without set parent in framed output:
rcmail.set_unread_count("&BBIEQQRP- &BD8EPgRHBEIEMA-",6,false,""); if(window.parent && parent.rcmail) parent.rcmail.set_env({"sieve_headers":[["Subject",
With set parent in framed output:
if(window.parent && parent.rcmail) parent.rcmail.set_unread_count("&BBIEQQRP- &BD8EPgRHBEIEMA-",5,false,""); if(window.parent && parent.rcmail) parent.rcmail.set_env({"sieve_headers":[["Subject"