From 62c86187444721317c7f3bcb2edb469f00ca0971 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 08 Nov 2011 13:50:08 -0500
Subject: [PATCH] Make email recipients separator configurable + suppress dupes in auto-completion

---
 program/steps/mail/compose.inc |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index c31ec9b..6961bf8 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -5,7 +5,7 @@
  | program/steps/mail/compose.inc                                        |
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
- | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
+ | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -122,8 +122,9 @@
 }
 // set current mailbox in client environment
 $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name());
-$OUTPUT->set_env('sig_above', $CONFIG['sig_above']);
-$OUTPUT->set_env('top_posting', $CONFIG['top_posting']);
+$OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false));
+$OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false));
+$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
 
 // get reference message and set compose mode
 if ($msg_uid = $_SESSION['compose']['param']['draft_uid']) {
@@ -324,6 +325,7 @@
 // Set other headers
 $a_recipients = array();
 $parts        = array('to', 'cc', 'bcc', 'replyto', 'followupto');
+$separator    = trim($RCMAIL->config->get('recipients_separator', ',')) . ' ';
 
 foreach ($parts as $header) {
   $fvalue = '';
@@ -367,7 +369,7 @@
       if ($v = $MESSAGE->headers->to)
         $fvalue .= $v;
       if ($v = $MESSAGE->headers->cc)
-        $fvalue .= (!empty($fvalue) ? ', ' : '') . $v;
+        $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
     }
   }
   else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) {
@@ -410,7 +412,7 @@
       }
     }
 
-    $fvalue = implode(', ', $fvalue);
+    $fvalue = implode($separator, $fvalue);
   }
 
   $MESSAGE->compose[$header] = $fvalue;

--
Gitblit v1.9.1