Send last fetch time with 'refresh' requests and allow plugins to alter query parameters of http requests
| | |
| | | } |
| | | |
| | | if ($RCMAIL->action == 'refresh') { |
| | | $RCMAIL->plugins->exec_hook('refresh', array()); |
| | | $RCMAIL->plugins->exec_hook('refresh', array('last' => intval(rcube_utils::get_input_value('_last', rcube_utils::INPUT_GPC)))); |
| | | } |
| | | |
| | | // parse main template (default) |
| | |
| | | |
| | | // flag object as complete |
| | | this.loaded = true; |
| | | this.env.lastrefresh = new Date(); |
| | | |
| | | // show message |
| | | if (this.pending_message) |
| | |
| | | if (result === false) |
| | | return false; |
| | | else |
| | | query = result; |
| | | url = this.url(action, result); |
| | | } |
| | | |
| | | url += '&_remote=1'; |
| | |
| | | if (this.task == 'mail' && this.gui_objects.mailboxlist) |
| | | params = this.check_recent_params(); |
| | | |
| | | params._last = Math.floor(this.env.lastrefresh.getTime() / 1000); |
| | | this.env.lastrefresh = new Date(); |
| | | |
| | | // plugins should bind to 'requestrefresh' event to add own params |
| | | this.http_request('refresh', params, lock); |
| | | }; |