From a54242c2b132855121615432d050aebda6526b93 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 08 Jun 2009 03:33:54 -0400
Subject: [PATCH] - Colorized signatures in plain text messages

---
 CHANGELOG                   |    1 +
 skins/default/mail.css      |    5 +++++
 program/steps/mail/func.inc |    9 ++++++++-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index fa7e9db..204c97d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Colorized signatures in plain text messages
 - Reviewed/fixed skip_deleted/read_when_deleted/flag_for_deletion options handling in UI
 - Fix displaying of big maximum upload filesize (#1485889)
 - Added possibility to invert messages selection
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 213b67e..6619138 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -819,7 +819,14 @@
     // quote plain text
     $body = Q(join("\n", $a_lines), 'replace', false);
 
-    // ... colorize quoted lines
+    // colorize signature
+    if (($sp = strrpos($body, '-- ')) !== false)
+      if (($sp == 0 || $body[$sp-1] == "\n") && $body[$sp+3] == "\n") {
+	$body = substr($body, 0, max(0, $sp))
+	    .'<span class="sig">'.substr($body, $sp).'</span>';
+      }
+
+    // colorize quoted lines
     $a_lines = preg_split('/\n/', $body);
     foreach ($q_lines as $i => $q)
       if ($q['quote'])
diff --git a/skins/default/mail.css b/skins/default/mail.css
index 8030313..f6087eb 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -884,6 +884,11 @@
   white-space: pre;
 }
 
+div.message-part span.sig
+{
+  color: #666666;
+}
+
 div.message-part blockquote
 {
   color: blue;

--
Gitblit v1.9.1