From bb6294a26e9ce1dca5e0b8f69a1144ea149e05fe Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 31 Mar 2010 11:45:02 -0400
Subject: [PATCH] Also remove contactgroupmembers when deleting a contact

---
 program/include/rcube_contacts.php |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php
index 0946b05..2964cde 100644
--- a/program/include/rcube_contacts.php
+++ b/program/include/rcube_contacts.php
@@ -399,6 +399,13 @@
     if (is_array($ids))
       $ids = join(',', $ids);
 
+    // delete all group members linked with these contacts
+    if ($this->groups) {
+      $this->db->query(
+        "DELETE FROM ".get_table_name('contactgroupmembers')."
+         WHERE  contact_id IN (".$ids.")");
+    }
+
     $this->db->query(
       "UPDATE ".$this->db_name."
        SET    del=1

--
Gitblit v1.9.1