From 9b2c66a07a868d0322f81d4edc1b65ac60a5234b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 30 Mar 2009 12:48:44 -0600 Subject: [PATCH] Better error handling. --- imp/lib/Message.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/imp/lib/Message.php b/imp/lib/Message.php index dffc48d23..61155092e 100644 --- a/imp/lib/Message.php +++ b/imp/lib/Message.php @@ -74,10 +74,6 @@ class IMP_Message { global $conf, $notification, $prefs; - if (($action == 'move') && $GLOBALS['imp_imap']->isReadOnly($targetMbox)) { - return false; - } - if ($conf['tasklist']['use_tasklist'] && (strpos($targetMbox, '_tasklist_') === 0)) { /* If the target is a tasklist, handle the move/copy specially. */ @@ -120,8 +116,14 @@ class IMP_Message foreach ($msgList as $mbox => $msgIndices) { $error = null; - if (($action == 'move') && $GLOBALS['imp_imap']->isReadOnly($mbox)) { - $error = _("The target directory is read-only."); + if ($GLOBALS['imp_imap']->isReadOnly($targetMbox)) { + $error = _("The target directory is read-only."); + } + + if (!$error && + ($action == 'move') && + $GLOBALS['imp_imap']->isReadOnly($mbox)) { + $error = _("The source directory is read-only."); } if (!$error) { -- 2.11.0