Skip to content

Commit

Permalink
[mms] Don't perform purge Spam login task unless Spam mailbox exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jul 11, 2014
1 parent e6ce8f7 commit e8f5198
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions imp/docs/CHANGES
Expand Up @@ -8,6 +8,7 @@ v6.3.0-git
v6.2.1
------

[mms] Don't perform purge Spam login task unless Spam mailbox exists.
[mms] Fix dragging a mailbox to the base level in dynamic view.
[mms] Add ability to drag/drop text to dynamic HTML compose window on Chrome
and IE.
Expand Down
23 changes: 18 additions & 5 deletions imp/lib/LoginTasks/Task/PurgeSpam.php
Expand Up @@ -28,8 +28,11 @@ class IMP_LoginTasks_Task_PurgeSpam extends Horde_LoginTasks_Task
*/
public function __construct()
{
if ($this->interval = $GLOBALS['prefs']->getValue('purge_spam_interval')) {
if ($GLOBALS['prefs']->isLocked('purge_spam_interval')) {
global $prefs;

if (($this->interval = $prefs->getValue('purge_spam_interval')) &&
$this->_spamMbox()) {
if ($prefs->isLocked('purge_spam_interval')) {
$this->display = Horde_LoginTasks::DISPLAY_NONE;
}
} else {
Expand All @@ -44,9 +47,7 @@ public function __construct()
*/
public function execute()
{
/* If there is no Spam mailbox set, or it doesn't exist, exit. */
if (!($spam = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_SPAM)) ||
!$spam->exists) {
if (!($spam = $this->_spamMbox())) {
return false;
}

Expand Down Expand Up @@ -83,4 +84,16 @@ public function describe()
$GLOBALS['prefs']->getValue('purge_spam_keep'));
}

/**
* Return the spam mailbox.
*
* @return IMP_Mailbox The spam mailbox, if it exists. Otherwise, false.
*/
protected function _spamMbox()
{
return (($spam = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_SPAM)) && $spam->exists)
? $spam
: false;
}

}
1 change: 1 addition & 0 deletions imp/package.xml
Expand Up @@ -3699,6 +3699,7 @@
<date>2014-07-08</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [mms] Don&apos;t perform purge Spam login task unless Spam mailbox exists.
* [mms] Fix dragging a mailbox to the base level in dynamic view.
* [mms] Add ability to drag/drop text to dynamic HTML compose window on Chrome and IE.
* [mms] Re-enable drag/drop of text to dynamic plaintext compose window (Bug #13281).
Expand Down

0 comments on commit e8f5198

Please sign in to comment.