From 053538bf60e354a64664fb9a992cbbda37d70f76 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 05 Mar 2012 14:59:07 -0500
Subject: [PATCH] - Merge r5966 from trunk (#1488375)

---
 program/steps/addressbook/func.inc |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index caf964d..ec97e81 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -728,6 +728,24 @@
 }
 
 
+function rcmail_contact_key($row, $sort_col)
+{
+    $key = $row[$sort_col] . ':' . $row['sourceid'];
+
+    // add email to a key to not skip contacts with the same name (#1488375)
+    if (!empty($row['email'])) {
+         if (is_array($row['email'])) {
+             $key .= ':' . implode(':', $row['email']);
+         }
+         else {
+             $key .= ':' . $row['email'];
+         }
+     }
+
+     return $key;
+}
+
+
 /**
  * Returns contact ID(s) and source(s) from GET/POST data
  *

--
Gitblit v1.9.1