Skip to content

Commit

Permalink
Fix clearing MDN status notification after sending in search mailboxes
Browse files Browse the repository at this point in the history
Conflicts:
	imp/lib/Ajax/Application/Handler/Dynamic.php
  • Loading branch information
slusarz committed Nov 19, 2014
1 parent 0287573 commit cb3a3d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
7 changes: 5 additions & 2 deletions imp/js/dimpbase.js
Expand Up @@ -2022,11 +2022,14 @@ var DimpBase = {

_sendMdnCallback: function(r)
{
this._expirePPCache([ this._getPPId(r.buid, r.mbox) ]);
this._expirePPCache([ this._getPPId(r.buid, r.view) ]);
if (r.mbox) {
this._expirePPCache([ this._getPPId(r.uid, r.mbox) ]);
}

if (this.pp &&
this.pp.VP_id == r.buid &&
this.pp.VP_view == r.mbox) {
this.pp.VP_view == r.view) {
$('sendMdnMessage').up(1).fade({ duration: 0.2 });
}
},
Expand Down
18 changes: 14 additions & 4 deletions imp/lib/Ajax/Application/Handler/Dynamic.php
Expand Up @@ -872,7 +872,11 @@ public function purgeDeleted()
*
* @return mixed False on failure, or an object with these properties:
* - buid: (integer) BUID of message.
* - mbox: (string) Mailbox of message (base64url encoded).
* - mbox: (string) Mailbox of message (base64url encoded). Only
* returned if view is a search mailbox.
* - uid: (string) Mailbox of message (base64url encoded). Only
* returned if view is a search mailbox.
* - view: (string) The view ID.
*/
public function sendMDN()
{
Expand All @@ -896,11 +900,17 @@ public function sendMDN()

$notification->push(_("The Message Disposition Notification was sent successfully."), 'horde.success');

list($mbox,) = $this->_base->indices->getSingle();
list($view, $buid) = $this->_base->indices->buids->getSingle();
list($mbox, $uid) = $this->_base->indices->getSingle();

$result = new stdClass;
$result->buid = $this->_base->vars->buid;
$result->mbox = $mbox->form_to;
$result->buid = $buid;
$result->view = $view->form_to;

if ($view != $mbox) {
$result->mbox = $mbox->form_to;
$result->uid = $uid;
}

return $result;
}
Expand Down

0 comments on commit cb3a3d3

Please sign in to comment.