From 51f7a5b2a09777d3a279757af620e42985ff9a86 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 09 Nov 2011 05:03:54 -0500
Subject: [PATCH] - Apply fixes from trunk up to r5401

---
 program/steps/mail/autocomplete.inc |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index 5b935ad..8b13f57 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -32,7 +32,8 @@
         $members[] = format_email_recipient($email, $sql_arr['name']);
     }
 
-    $OUTPUT->command('replace_group_recipients', $gid, join(', ', $members));
+    $separator = trim($RCMAIL->config->get('recipients_separator', ',')) . ' ';
+    $OUTPUT->command('replace_group_recipients', $gid, join($separator, array_unique($members)));
   }
 
   $OUTPUT->send();
@@ -70,8 +71,8 @@
           if ($email_cnt > 1 && stripos($contact, $search) === false) {
             continue;
           }
-          // when we've got more than one book, we need to skip duplicates
-          if ($books_num == 1 || !in_array($contact, $contacts)) {
+          // skip duplicates
+          if (!in_array($contact, $contacts)) {
             $contacts[] = $contact;
             if (count($contacts) >= $MAXNUM)
               break 2;

--
Gitblit v1.9.1