update dirty flag checking 60/47860/1
authorGukhwan Cho <gh78.cho@samsung.com>
Wed, 9 Sep 2015 03:06:30 +0000 (12:06 +0900)
committerGukhwan Cho <gh78.cho@samsung.com>
Wed, 9 Sep 2015 11:05:24 +0000 (20:05 +0900)
Change-Id: Ife71b82120da5f80735b3150a5788f67d57ee9f8
Signed-off-by: Gukhwan Cho <gh78.cho@samsung.com>
server/db/ctsvc_db_plugin_person.c

index e94c338..ee0ce08 100644 (file)
@@ -188,14 +188,14 @@ static int __ctsvc_db_person_update_record(contacts_record_h record)
        /* update favorite */
        index_favorite = CTSVC_PROPERTY_PERSON_IS_FAVORITE & 0x000000FF;
        if (person->base.properties_flags &&
-                       CTSVC_PROPERTY_FLAG_DIRTY == person->base.properties_flags[index_favorite]) {
+                               ctsvc_record_check_property_flag(person, index_favorite, CTSVC_PROPERTY_FLAG_DIRTY)) {
                ret = ctsvc_db_person_set_favorite(person->person_id, person->is_favorite, true);
                if (CONTACTS_ERROR_NONE != ret) {
                        CTS_ERR("ctsvc_db_person_set_favorite() Fail(%d)", ret);
                        ctsvc_end_trans(false);
                        return ret;
                }
-               person->base.properties_flags[index_favorite] = 0;
+               person->base.properties_flags[index_favorite] &= 0xFFFFFFFD; /* remove dirty bit */
                ctsvc_set_contact_noti();
        }