Fix Nabi issues. (Email contact sync & Noti icon) tizen_2.1 accepted/tizen/20130520.101103 submit/tizen/20130517.044947 submit/tizen_2.1/20130515.031035
authorKeebum Kim <keebum.kim@samsung.com>
Tue, 14 May 2013 12:29:58 +0000 (21:29 +0900)
committerKeebum Kim <keebum.kim@samsung.com>
Tue, 14 May 2013 12:29:58 +0000 (21:29 +0900)
Change-Id: Ib06d9b31c1a72ae6f875fd8d7ab30694ce97fc6e

include/utils/MsgNotificationWrapper.h
utils/MsgContact.cpp

index 75e7c6f..a5c7706 100755 (executable)
 ==================================================================================================*/
 #define MSG_APP_PACKAGE_NAME   "message"
 #define MSG_SYS_PACKAGE_NAME   "sys_string"
-#define NORMAL_MSG_ICON_PATH   "/usr/apps/org.tizen.message/res/icons/default/small/org.tizen.message.noti.png"
-#define VOICE_MSG_ICON_PATH            "/usr/apps/org.tizen.message/res/icons/default/small/org.tizen.message.voice.png"
-#define CB_MSG_ICON_PATH                       "/usr/apps/org.tizen.message/res/icons/default/small/org.tizen.message.noti.png"
-#define NOTI_MSG_ICON_PATH             "/usr/apps/org.tizen.message/res/icons/default/small/org.tizen.message.noti.png"
+#define NORMAL_MSG_ICON_PATH           "/opt/usr/apps/8r4r5ddzzn/shared/res/screen-density-xhigh/mainmenu.png"
+#define VOICE_MSG_ICON_PATH                    "/opt/usr/apps/8r4r5ddzzn/shared/res/screen-density-xhigh/mainmenu.png"
+#define CB_MSG_ICON_PATH                               "/opt/usr/apps/8r4r5ddzzn/shared/res/screen-density-xhigh/mainmenu.png"
+#define NOTI_MSG_ICON_PATH                     "/opt/usr/apps/8r4r5ddzzn/shared/res/screen-density-xhigh/mainmenu.png"
 
 #define MSG_APP_LOCALEDIR                      "/usr/apps/org.tizen.message/res/locale"
+
 #define SENDING_MULTIMEDIA_MESSAGE_FAILED      "Sending multimedia message failed"
 #define MULTIMEDIA_MESSAGE_SENT                                        "Multimedia message sent"
 #define RETRIEVING_MESSAGE_FAILED                                      "Retrieving message failed"
 #define MESSAGE_RETRIEVED                                                              "Message retrieved"
-#define SMS_MESSAGE_SENT                                       "Message sent"
-#define SMS_MESSAGE_SENDING_FAIL                       "Sending message failed"
+#define SMS_MESSAGE_SENT                                                               "Message sent"
+#define SMS_MESSAGE_SENDING_FAIL                                       "Sending message failed"
+
 #define MESSAGE                                                "Message"
 #define NEW_MESSAGE                            "New message"
 #define NEW_MESSAGES                   "New messages"
-#define MSG_SYS_LOCALEDIR                      "/usr/share/locale"
+
+#define MSG_SYS_LOCALEDIR      "/usr/share/locale"
 
 #define NOTIFICATION_PRIV_ID DEFAULT_SETTING_PATH"/notification_priv_id"
 
index 3fc9512..5b75e67 100755 (executable)
@@ -492,10 +492,12 @@ bool MsgUpdateContact(int index, int type)
                return false;
        }
 
+       MSG_DEBUG("_contacts_contact.number count [%d]", count);
+
        if (count > 0) {
                for(unsigned int i=0; i < count; i++)
                {
-                       MSG_DEBUG("Add Contact Data");
+                       MSG_DEBUG("Add Number Contact Data");
 
                        contacts_record_h number = NULL;
 
@@ -521,9 +523,47 @@ bool MsgUpdateContact(int index, int type)
                                }
                        }
                }
-       } else {// No phone number in contact
+       }
+
+       count = 0;
+       ret = contacts_record_get_child_record_count(contact, _contacts_contact.email, &count);
+       if (ret != CONTACTS_ERROR_NONE) {
+               MSG_DEBUG("contacts_record_get_child_record_count() Error [%d]", ret);
                contacts_record_destroy(contact, true);
-               return true;
+               return false;
+       }
+
+       MSG_DEBUG("_contacts_contact.email count [%d]", count);
+
+       if (count > 0) {
+               for(unsigned int i=0; i < count; i++)
+               {
+                       MSG_DEBUG("Add Email Contact Data");
+
+                       contacts_record_h email = NULL;
+
+                       ret = contacts_record_get_child_record_at_p(contact, _contacts_contact.email, i, &email);
+                       if (ret != CONTACTS_ERROR_NONE) {
+                               MSG_DEBUG("contacts_record_get_child_record_at_p() Error [%d]", ret);
+                               contacts_record_destroy(contact, true);
+                               return false;
+                       }
+
+                       char* strNumber = NULL;
+                       ret = contacts_record_get_str_p(email, _contacts_email.email, &strNumber);
+                       if (ret != CONTACTS_ERROR_NONE) {
+                               MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret);
+                               contacts_record_destroy(contact, true);
+                               return false;
+                       }
+
+                       if (strNumber != NULL) {
+                               MSG_DEBUG("email = %s", strNumber);
+                               if (!MsgInsertContact(&contactInfo, strNumber)) {
+                                       MSG_DEBUG("MsgInsertContact fail.");
+                               }
+                       }
+               }
        }
 
        MsgStoSetConversationDisplayName(&ContactDbHandle, index);