From 09941ea763db08c7b13263fae68cf6eb01bc7bcf Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 13 Oct 2005 17:53:33 -0400
Subject: [PATCH] Some error messages added

---
 program/steps/mail/compose.inc       |    9 +++++++--
 program/steps/mail/func.inc          |    2 +-
 program/localization/en/messages.inc |    4 ++++
 program/js/app.js                    |   10 ++++++----
 program/include/rcube_imap.inc       |    1 -
 program/steps/mail/move_del.inc      |    6 ++++++
 6 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 6985212..e927dc7 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -579,7 +579,6 @@
       }
 
     return $deleted;
-
     }
 
 
diff --git a/program/js/app.js b/program/js/app.js
index 3182ce3..3837a31 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -6,7 +6,7 @@
  | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
- | Modified: 2005/08/19 (tbr)                                            |
+ | Modified: 2005/10/13 (tbr)                                            |
  |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
@@ -565,12 +565,14 @@
 
       case 'nextmessage':
         if (this.env.next_uid)
-          location.href = this.env.comm_path+'&_action=show&_uid='+this.env.next_uid+'&_mbox='+this.env.mailbox;
+          this.show_message(this.env.next_uid);
+          //location.href = this.env.comm_path+'&_action=show&_uid='+this.env.next_uid+'&_mbox='+this.env.mailbox;
         break;
 
       case 'previousmessage':
         if (this.env.prev_uid)
-          location.href = this.env.comm_path+'&_action=show&_uid='+this.env.prev_uid+'&_mbox='+this.env.mailbox;
+          this.show_message(this.env.prev_uid);
+          //location.href = this.env.comm_path+'&_action=show&_uid='+this.env.prev_uid+'&_mbox='+this.env.mailbox;
         break;
 
       case 'compose':
@@ -964,7 +966,7 @@
 
     if (id)
       {
-      this.set_busy(true);   
+      this.set_busy(true, 'loading');
       target.location.href = this.env.comm_path+'&_action=show&_uid='+id+'&_mbox='+escape(this.env.mailbox)+add_url;
       }
     };
diff --git a/program/localization/en/messages.inc b/program/localization/en/messages.inc
index 4a9009a..0ad04ed 100644
--- a/program/localization/en/messages.inc
+++ b/program/localization/en/messages.inc
@@ -52,5 +52,9 @@
 
 $messages['errorsaving'] = 'An error occured while saving';
 
+$messages['errormoving'] = 'Could not move the message';
+
+$messages['errordeleting'] = 'Could not delete the message';
+
 
 ?>
\ No newline at end of file
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index f65e4ff..52b64d8 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -404,7 +404,7 @@
   // create a reply-subject
   else if (isset($REPLY_MESSAGE['subject']))
     {
-    if (strpos($REPLY_MESSAGE['subject'], 'Re:')===0)
+    if (eregi('^re:', $REPLY_MESSAGE['subject']))
       $subject = $REPLY_MESSAGE['subject'];
     else
       $subject = 'Re: '.$REPLY_MESSAGE['subject'];
@@ -412,7 +412,12 @@
 
   // create a forward-subject
   else if (isset($FORWARD_MESSAGE['subject']))
-    $subject = 'Fwd: '.$FORWARD_MESSAGE['subject'];
+    {
+    if (eregi('^fwd:', $REPLY_MESSAGE['subject']))
+      $subject = $FORWARD_MESSAGE['subject'];
+    else
+      $subject = 'Fwd: '.$FORWARD_MESSAGE['subject'];
+    }
 
   
   $out = $form_start ? "$form_start\n" : '';
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 6ffde1c..e3437db 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -549,7 +549,7 @@
     // make links and email-addresses clickable
     $convert_patterns = $convert_replaces = $replace_strings = array();
     
-    $url_chars = 'a-z0-9_\-\+\*\$\/&%=@#';
+    $url_chars = 'a-z0-9_\-\+\*\$\/&%=@#:';
     $url_chars_within = '\?\.~,!';
 
     $convert_patterns[] = "/([\w]+):\/\/([a-z0-9\-\.]+[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/ie";
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index 4972478..20d46e3 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -30,6 +30,9 @@
   if (!$moved)
     {
     // send error message
+    $commands = "this.list_mailbox();\n";
+    $commands .= show_message('errormoving', 'error');
+    rcube_remote_response($commands);
     exit;
     }
   }
@@ -43,6 +46,9 @@
   if (!$del)
     {
     // send error message
+    $commands = "this.list_mailbox();\n";
+    $commands .= show_message('errordeleting', 'error');
+    rcube_remote_response($commands);
     exit;
     }
   }

--
Gitblit v1.9.1