OSDN Git Service

remove db trigger to delete chats when a contact is deleted.
authorWei Huang <weih@google.com>
Mon, 27 Apr 2009 17:06:11 +0000 (10:06 -0700)
committerWei Huang <weih@google.com>
Mon, 27 Apr 2009 17:06:11 +0000 (10:06 -0700)
The trigger would cause a bug where all chats are removed when we sync the roster from mcs during a reconnect,
because we delete all old contacts and insert the new contacts.

src/com/android/providers/im/ImProvider.java

index a0d1d15..bb53b6f 100644 (file)
@@ -503,17 +503,6 @@ public class ImProvider extends ContentProvider {
                     "unsent_composed_message TEXT," + // a composed, but not sent message
                     "shortcut INTEGER" + // which of 10 slots (if any) this chat occupies
                     ");");
-
-            if (MAKE_MESSAGE_PRESENCE_CHAT_PERSISTENT) {
-                String contactsTableName = TABLE_CONTACTS;
-
-                db.execSQL("CREATE TRIGGER IF NOT EXISTS contact_cleanup " +
-                        "DELETE ON " + contactsTableName +
-                           " BEGIN " +
-                               "DELETE FROM chats WHERE contact_id = OLD._id;" +
-                           "END");
-            }
-
         }
 
         @Override