[MPR-988, MPR-989] support group message 43/107043/2
authorKyeonghun Lee <kh9090.lee@samsung.com>
Mon, 26 Dec 2016 08:03:12 +0000 (17:03 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Fri, 20 Jan 2017 04:27:16 +0000 (13:27 +0900)
- add a db table for group message's recipients
- add setting option for group message

Change-Id: If1040fdf69c780a01e1989e6f9f87ccf609c4cb4
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
16 files changed:
config/msg-service-db.sql
framework/setting-handler/MsgSettingHandler.cpp
framework/storage-handler/MsgStorageManager.cpp
framework/storage-handler/MsgStorageMessage.cpp
framework/storage-handler/MsgStorageMms.cpp
framework/transaction-manager/MsgCmdHandlerTransport.cpp
include/common/MsgInternalTypes.h
include/common/MsgSettingTypes.h
include/mapi/msg_types.h
include/utils/MsgSqliteWrapper.h
include/utils/MsgUtilStorage.h
mapi/msg_setting.cpp
plugin/mms_plugin/MmsPluginInternal.cpp
plugin/mms_plugin/MmsPluginStorage.cpp
plugin/mms_plugin/include/MmsPluginStorage.h
utils/MsgUtilStorage.cpp

index 05b8eb4..affa62e 100755 (executable)
@@ -1,4 +1,4 @@
-PRAGMA user_version=2;
+PRAGMA user_version=3;
 
 CREATE TABLE MSG_CONVERSATION_TABLE
 (
@@ -180,6 +180,16 @@ CREATE TABLE MSG_MMS_PREVIEW_INFO_TABLE
        FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
 );
 
+CREATE TABLE MSG_MMS_RECIPIENTS_TABLE
+(
+       MSG_ID INTEGER NOT NULL ,
+       ADDRESS_TYPE INTEGER DEFAULT 0 ,
+       RECIPIENT_TYPE INTEGER DEFAULT 0 ,
+       ADDRESS_VAL TEXT NOT NULL DEFAULT '' ,
+
+       FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID)
+);
+
 CREATE TABLE MSG_SMS_REPORT_TABLE
 (
        MSG_ID INTEGER NOT NULL ,
index 78159ad..671958e 100755 (executable)
@@ -257,7 +257,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.bKeepCopy != generalOpt.bKeepCopy) {
                if (MsgSettingSetBool(MSG_KEEP_COPY, generalOpt.bKeepCopy) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_KEEP_COPY);
+                       MSG_ERR("Error to set config data [%s]", MSG_KEEP_COPY);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.bKeepCopy = generalOpt.bKeepCopy;
@@ -265,7 +265,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.bAutoErase != generalOpt.bAutoErase) {
                if (MsgSettingSetBool(MSG_AUTO_ERASE, generalOpt.bAutoErase) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_AUTO_ERASE);
+                       MSG_ERR("Error to set config data [%s]", MSG_AUTO_ERASE);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.bAutoErase = generalOpt.bAutoErase;
@@ -273,7 +273,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.bBlockUnknownMsg != generalOpt.bBlockUnknownMsg) {
                if (MsgSettingSetBool(MSG_BLOCK_UNKNOWN_MSG, generalOpt.bBlockUnknownMsg) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_BLOCK_UNKNOWN_MSG);
+                       MSG_ERR("Error to set config data [%s]", MSG_BLOCK_UNKNOWN_MSG);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.bBlockUnknownMsg = generalOpt.bBlockUnknownMsg;
@@ -281,7 +281,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.smsLimitCnt != generalOpt.smsLimitCnt) {
                if (MsgSettingSetInt(MSG_SMS_LIMIT, (int)generalOpt.smsLimitCnt) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_SMS_LIMIT);
+                       MSG_ERR("Error to set config data [%s]", MSG_SMS_LIMIT);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.smsLimitCnt = generalOpt.smsLimitCnt;
@@ -289,7 +289,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.mmsLimitCnt != generalOpt.mmsLimitCnt) {
                if (MsgSettingSetInt(MSG_MMS_LIMIT, (int)generalOpt.mmsLimitCnt) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_MMS_LIMIT);
+                       MSG_ERR("Error to set config data [%s]", MSG_MMS_LIMIT);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.mmsLimitCnt = generalOpt.mmsLimitCnt;
@@ -297,7 +297,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.bNotification != generalOpt.bNotification) {
                if (MsgSettingSetBool(MSG_SETTING_NOTIFICATION, generalOpt.bNotification) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_NOTIFICATION);
+                       MSG_ERR("Error to set config data [%s]", MSG_SETTING_NOTIFICATION);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.bNotification = generalOpt.bNotification;
@@ -305,7 +305,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.bVibration != generalOpt.bVibration) {
                if (MsgSettingSetBool(MSG_SETTING_VIBRATION, generalOpt.bVibration) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_VIBRATION);
+                       MSG_ERR("Error to set config data [%s]", MSG_SETTING_VIBRATION);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.bVibration = generalOpt.bVibration;
@@ -313,7 +313,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.bPreview != generalOpt.bPreview) {
                if (MsgSettingSetBool(MSG_SETTING_PREVIEW, generalOpt.bPreview) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_PREVIEW);
+                       MSG_ERR("Error to set config data [%s]", MSG_SETTING_PREVIEW);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.bPreview = generalOpt.bPreview;
@@ -321,7 +321,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.ringtoneType != generalOpt.ringtoneType) {
                if (MsgSettingSetInt(MSG_SETTING_RINGTONE_TYPE, generalOpt.ringtoneType) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_RINGTONE_TYPE);
+                       MSG_ERR("Error to set config data [%s]", MSG_SETTING_RINGTONE_TYPE);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.ringtoneType = generalOpt.ringtoneType;
@@ -329,13 +329,13 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (generalOpt.ringtoneType == MSG_RINGTONE_TYPE_SILENT) {
                if (MsgSettingSetString(MSG_SETTING_RINGTONE_PATH, "") != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_RINGTONE_PATH);
+                       MSG_ERR("Error to set config data [%s]", MSG_SETTING_RINGTONE_PATH);
                        return MSG_ERR_SET_SETTING;
                }
        } else {
                if (g_strcmp0(g_generalOpt.ringtonePath, generalOpt.ringtonePath) != 0) {
                        if (MsgSettingSetString(MSG_SETTING_RINGTONE_PATH, generalOpt.ringtonePath) != MSG_SUCCESS) {
-                               MSG_DEBUG("Error to set config data [%s]", MSG_SETTING_RINGTONE_PATH);
+                               MSG_ERR("Error to set config data [%s]", MSG_SETTING_RINGTONE_PATH);
                                return MSG_ERR_SET_SETTING;
                        }
                        memset(g_generalOpt.ringtonePath, 0x00, sizeof(g_generalOpt.ringtonePath));
@@ -345,7 +345,7 @@ msg_error_t MsgSetGeneralOpt(const MSG_SETTING_S *pSetting)
 
        if (g_generalOpt.alertTone != generalOpt.alertTone) {
                if (MsgSettingSetInt(MSG_ALERT_REP_TYPE, (int)generalOpt.alertTone) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSG_ALERT_REP_TYPE);
+                       MSG_ERR("Error to set config data [%s]", MSG_ALERT_REP_TYPE);
                        return MSG_ERR_SET_SETTING;
                }
                g_generalOpt.alertTone = generalOpt.alertTone;
@@ -363,7 +363,7 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_smsSendOpt.dcs != sendOpt.dcs) {
                if (MsgSettingSetInt(SMS_SEND_DCS, (int)sendOpt.dcs) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", SMS_SEND_DCS);
+                       MSG_ERR("Error to set config data [%s]", SMS_SEND_DCS);
                        return MSG_ERR_SET_SETTING;
                }
                g_smsSendOpt.dcs = sendOpt.dcs;
@@ -371,7 +371,7 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_smsSendOpt.netMode != sendOpt.netMode) {
                if (MsgSettingSetInt(SMS_SEND_NETWORK_MODE, (int)sendOpt.netMode) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", SMS_SEND_NETWORK_MODE);
+                       MSG_ERR("Error to set config data [%s]", SMS_SEND_NETWORK_MODE);
                        return MSG_ERR_SET_SETTING;
                }
                g_smsSendOpt.netMode = sendOpt.netMode;
@@ -379,7 +379,7 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_smsSendOpt.bReplyPath != sendOpt.bReplyPath) {
                if (MsgSettingSetBool(SMS_SEND_REPLY_PATH, sendOpt.bReplyPath) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", SMS_SEND_REPLY_PATH);
+                       MSG_ERR("Error to set config data [%s]", SMS_SEND_REPLY_PATH);
                        return MSG_ERR_SET_SETTING;
                }
                g_smsSendOpt.bReplyPath = sendOpt.bReplyPath;
@@ -387,7 +387,7 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_smsSendOpt.bDeliveryReport != sendOpt.bDeliveryReport) {
                if (MsgSettingSetBool(SMS_SEND_DELIVERY_REPORT, sendOpt.bDeliveryReport) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", SMS_SEND_DELIVERY_REPORT);
+                       MSG_ERR("Error to set config data [%s]", SMS_SEND_DELIVERY_REPORT);
                        return MSG_ERR_SET_SETTING;
                }
                g_smsSendOpt.bDeliveryReport = sendOpt.bDeliveryReport;
@@ -395,7 +395,7 @@ msg_error_t MsgSetSMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_smsSendOpt.saveStorage != sendOpt.saveStorage) {
                if (MsgSettingSetInt(SMS_SEND_SAVE_STORAGE, (int)sendOpt.saveStorage) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", SMS_SEND_SAVE_STORAGE);
+                       MSG_ERR("Error to set config data [%s]", SMS_SEND_SAVE_STORAGE);
                        return MSG_ERR_SET_SETTING;
                }
                g_smsSendOpt.saveStorage = sendOpt.saveStorage;
@@ -446,7 +446,7 @@ msg_error_t MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim)
                err = MsgSetConfigInSim(pSetting);
 
                if (err != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data in sim [%d]", err);
+                       MSG_ERR("Error to set config data in sim [%d]", err);
                        return err;
                }
        }
@@ -463,7 +463,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.msgClass != sendOpt.msgClass) {
                if (MsgSettingSetInt(MMS_SEND_MSG_CLASS, (int)sendOpt.msgClass) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_MSG_CLASS);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_MSG_CLASS);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.msgClass = sendOpt.msgClass;
@@ -471,7 +471,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.priority != sendOpt.priority) {
                if (MsgSettingSetInt(MMS_SEND_PRIORITY, (int)sendOpt.priority) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_PRIORITY);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_PRIORITY);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.priority = sendOpt.priority;
@@ -479,7 +479,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.expiryTime != sendOpt.expiryTime) {
                if (MsgSettingSetInt(MMS_SEND_EXPIRY_TIME, (int)sendOpt.expiryTime) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_EXPIRY_TIME);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_EXPIRY_TIME);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.expiryTime = sendOpt.expiryTime;
@@ -487,7 +487,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.deliveryTime != sendOpt.deliveryTime) {
                if (MsgSettingSetInt(MMS_SEND_DELIVERY_TIME, (int)sendOpt.deliveryTime) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_DELIVERY_TIME);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_DELIVERY_TIME);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.deliveryTime = sendOpt.deliveryTime;
@@ -495,7 +495,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.customDeliveryTime != sendOpt.customDeliveryTime) {
                if (MsgSettingSetInt(MMS_SEND_CUSTOM_DELIVERY, sendOpt.customDeliveryTime) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_CUSTOM_DELIVERY);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_CUSTOM_DELIVERY);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.customDeliveryTime = sendOpt.customDeliveryTime;
@@ -503,7 +503,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.bSenderVisibility != sendOpt.bSenderVisibility) {
                if (MsgSettingSetBool(MMS_SEND_SENDER_VISIBILITY, sendOpt.bSenderVisibility) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_SENDER_VISIBILITY);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_SENDER_VISIBILITY);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.bSenderVisibility = sendOpt.bSenderVisibility;
@@ -511,7 +511,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.bDeliveryReport != sendOpt.bDeliveryReport) {
                if (MsgSettingSetBool(MMS_SEND_DELIVERY_REPORT, sendOpt.bDeliveryReport) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_DELIVERY_REPORT);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_DELIVERY_REPORT);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.bDeliveryReport = sendOpt.bDeliveryReport;
@@ -519,21 +519,21 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.bReadReply != sendOpt.bReadReply) {
                if (MsgSettingSetBool(MMS_SEND_READ_REPLY, sendOpt.bReadReply) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_READ_REPLY);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_READ_REPLY);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.bReadReply = sendOpt.bReadReply;
        }
 #ifdef __NOT_USED_BY_DESIGN_CHANGE__
        if (MsgSettingSetBool(MMS_SEND_KEEP_COPY, sendOpt.bKeepCopy) != MSG_SUCCESS) {
-               MSG_DEBUG("Error to set config data [%s]", MMS_SEND_KEEP_COPY);
+               MSG_ERR("Error to set config data [%s]", MMS_SEND_KEEP_COPY);
                return MSG_ERR_SET_SETTING;
        }
 #endif /* __NOT_USED_BY_DESIGN_CHANGE__ */
 
        if (g_mmsSendOpt.bBodyReplying != sendOpt.bBodyReplying) {
                if (MsgSettingSetBool(MMS_SEND_BODY_REPLYING, sendOpt.bBodyReplying) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_BODY_REPLYING);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_BODY_REPLYING);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.bBodyReplying = sendOpt.bBodyReplying;
@@ -541,14 +541,14 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.bHideRecipients != sendOpt.bHideRecipients) {
                if (MsgSettingSetBool(MMS_SEND_HIDE_RECIPIENTS, sendOpt.bHideRecipients) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_HIDE_RECIPIENTS);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_HIDE_RECIPIENTS);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.bHideRecipients = sendOpt.bHideRecipients;
        }
        if (g_mmsSendOpt.replyCharging != sendOpt.replyCharging) {
                if (MsgSettingSetInt(MMS_SEND_REPLY_CHARGING, sendOpt.replyCharging) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.replyCharging = sendOpt.replyCharging;
@@ -556,7 +556,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.replyChargingDeadline != sendOpt.replyChargingDeadline) {
                if (MsgSettingSetInt(MMS_SEND_REPLY_CHARGING_DEADLINE, sendOpt.replyChargingDeadline) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING_DEADLINE);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING_DEADLINE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.replyChargingDeadline = sendOpt.replyChargingDeadline;
@@ -564,7 +564,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.replyChargingSize != sendOpt.replyChargingSize) {
                if (MsgSettingSetInt(MMS_SEND_REPLY_CHARGING_SIZE, sendOpt.replyChargingSize) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING_SIZE);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_REPLY_CHARGING_SIZE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.replyChargingSize = sendOpt.replyChargingSize;
@@ -572,7 +572,7 @@ msg_error_t MsgSetMMSSendOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsSendOpt.creationMode != sendOpt.creationMode) {
                if (MsgSettingSetInt(MMS_SEND_CREATION_MODE, sendOpt.creationMode) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_SEND_CREATION_MODE);
+                       MSG_ERR("Error to set config data [%s]", MMS_SEND_CREATION_MODE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsSendOpt.creationMode = sendOpt.creationMode;
@@ -590,7 +590,7 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsRecvOpt.homeNetwork != recvOpt.homeNetwork) {
                if (MsgSettingSetInt(MMS_RECV_HOME_NETWORK, (int)recvOpt.homeNetwork) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_RECV_HOME_NETWORK);
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_HOME_NETWORK);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsRecvOpt.homeNetwork = recvOpt.homeNetwork;
@@ -598,7 +598,7 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsRecvOpt.abroadNetwork != recvOpt.abroadNetwork) {
                if (MsgSettingSetInt(MMS_RECV_ABROAD_NETWORK, (int)recvOpt.abroadNetwork) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_RECV_ABROAD_NETWORK);
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_ABROAD_NETWORK);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsRecvOpt.abroadNetwork = recvOpt.abroadNetwork;
@@ -606,7 +606,7 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsRecvOpt.readReceipt != recvOpt.readReceipt) {
                if (MsgSettingSetBool(MMS_RECV_READ_RECEIPT, recvOpt.readReceipt) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_RECV_READ_RECEIPT);
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_READ_RECEIPT);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsRecvOpt.readReceipt = recvOpt.readReceipt;
@@ -614,7 +614,7 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsRecvOpt.bDeliveryReceipt != recvOpt.bDeliveryReceipt) {
                if (MsgSettingSetBool(MMS_RECV_DELIVERY_RECEIPT, recvOpt.bDeliveryReceipt) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_RECV_DELIVERY_RECEIPT);
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_DELIVERY_RECEIPT);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsRecvOpt.bDeliveryReceipt = recvOpt.bDeliveryReceipt;
@@ -622,7 +622,7 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsRecvOpt.bRejectUnknown != recvOpt.bRejectUnknown) {
                if (MsgSettingSetBool(MMS_RECV_REJECT_UNKNOWN, recvOpt.bRejectUnknown) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_RECV_REJECT_UNKNOWN);
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_REJECT_UNKNOWN);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsRecvOpt.bRejectUnknown = recvOpt.bRejectUnknown;
@@ -630,12 +630,20 @@ msg_error_t MsgSetMMSRecvOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsRecvOpt.bRejectAdvertisement != recvOpt.bRejectAdvertisement) {
                if (MsgSettingSetBool(MMS_RECV_REJECT_ADVERTISE, recvOpt.bRejectAdvertisement) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_RECV_REJECT_ADVERTISE);
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_REJECT_ADVERTISE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsRecvOpt.bRejectAdvertisement = recvOpt.bRejectAdvertisement;
        }
 
+       if (g_mmsRecvOpt.bGroupMessage != recvOpt.bGroupMessage) {
+               if (MsgSettingSetBool(MMS_RECV_GROUP_MESSAGE, recvOpt.bGroupMessage) != MSG_SUCCESS) {
+                       MSG_ERR("Error to set config data [%s]", MMS_RECV_GROUP_MESSAGE);
+                       return MSG_ERR_SET_SETTING;
+               }
+               g_mmsRecvOpt.bGroupMessage = recvOpt.bGroupMessage;
+       }
+
        return MSG_SUCCESS;
 }
 
@@ -648,7 +656,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.fontSize != styleOpt.fontSize) {
                if (MsgSettingSetInt(MMS_STYLE_FONT_SIZE, styleOpt.fontSize) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_SIZE);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_SIZE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.fontSize = styleOpt.fontSize;
@@ -656,7 +664,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bFontStyleBold != styleOpt.bFontStyleBold) {
                if (MsgSettingSetBool(MMS_STYLE_FONT_STYLE_BOLD, styleOpt.bFontStyleBold) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_BOLD);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_BOLD);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bFontStyleBold = styleOpt.bFontStyleBold;
@@ -664,7 +672,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bFontStyleItalic != styleOpt.bFontStyleItalic) {
                if (MsgSettingSetBool(MMS_STYLE_FONT_STYLE_ITALIC, styleOpt.bFontStyleItalic) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_ITALIC);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_ITALIC);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bFontStyleItalic = styleOpt.bFontStyleItalic;
@@ -672,7 +680,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bFontStyleUnderline != styleOpt.bFontStyleUnderline) {
                if (MsgSettingSetBool(MMS_STYLE_FONT_STYLE_UNDERLINE, styleOpt.bFontStyleUnderline) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_UNDERLINE);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_STYLE_UNDERLINE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bFontStyleUnderline = styleOpt.bFontStyleUnderline;
@@ -680,7 +688,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.fontColorRed != styleOpt.fontColorRed) {
                if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_RED, styleOpt.fontColorRed) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_RED);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_RED);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.fontColorRed = styleOpt.fontColorRed;
@@ -688,7 +696,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.fontColorGreen != styleOpt.fontColorGreen) {
                if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_GREEN, styleOpt.fontColorGreen) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_GREEN);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_GREEN);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.fontColorGreen = styleOpt.fontColorGreen;
@@ -696,7 +704,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.fontColorBlue != styleOpt.fontColorBlue) {
                if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_BLUE, styleOpt.fontColorBlue) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_BLUE);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_BLUE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.fontColorBlue = styleOpt.fontColorBlue;
@@ -704,7 +712,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.fontColorHue != styleOpt.fontColorHue) {
                if (MsgSettingSetInt(MMS_STYLE_FONT_COLOR_HUE, styleOpt.fontColorHue) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_HUE);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_FONT_COLOR_HUE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.fontColorHue = styleOpt.fontColorHue;
@@ -712,7 +720,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bgColorRed != styleOpt.bgColorRed) {
                if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_RED, styleOpt.bgColorRed) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_RED);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_BG_COLOR_RED);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bgColorRed = styleOpt.bgColorRed;
@@ -720,7 +728,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bgColorGreen != styleOpt.bgColorGreen) {
                if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_GREEN, styleOpt.bgColorGreen) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_GREEN);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_BG_COLOR_GREEN);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bgColorGreen = styleOpt.bgColorGreen;
@@ -728,7 +736,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bgColorBlue != styleOpt.bgColorBlue) {
                if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_BLUE, styleOpt.bgColorBlue) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_BLUE);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_BG_COLOR_BLUE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bgColorBlue = styleOpt.bgColorBlue;
@@ -736,7 +744,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.bgColorHue != styleOpt.bgColorHue) {
                if (MsgSettingSetInt(MMS_STYLE_BG_COLOR_HUE, styleOpt.bgColorHue) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_BG_COLOR_HUE);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_BG_COLOR_HUE);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.bgColorHue = styleOpt.bgColorHue;
@@ -744,7 +752,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.pageDur != styleOpt.pageDur) {
                if (MsgSettingSetInt(MMS_STYLE_PAGE_DUR, styleOpt.pageDur) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_PAGE_DUR);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_PAGE_DUR);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.pageDur = styleOpt.pageDur;
@@ -752,7 +760,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.pageCustomDur != styleOpt.pageCustomDur) {
                if (MsgSettingSetInt(MMS_STYLE_PAGE_CUSTOM_DUR, styleOpt.pageCustomDur) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_PAGE_CUSTOM_DUR);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_PAGE_CUSTOM_DUR);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.pageCustomDur = styleOpt.pageCustomDur;
@@ -760,7 +768,7 @@ msg_error_t MsgSetMMSStyleOpt(const MSG_SETTING_S *pSetting)
 
        if (g_mmsStyleOpt.pageDurManual != styleOpt.pageDurManual) {
                if (MsgSettingSetInt(MMS_STYLE_PAGE_DUR_MANUAL, styleOpt.pageDurManual) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MMS_STYLE_PAGE_DUR_MANUAL);
+                       MSG_ERR("Error to set config data [%s]", MMS_STYLE_PAGE_DUR_MANUAL);
                        return MSG_ERR_SET_SETTING;
                }
                g_mmsStyleOpt.pageDurManual = styleOpt.pageDurManual;
@@ -777,7 +785,7 @@ msg_error_t MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting)
 
        if (g_pushMsgOpt.bReceive != pushOpt.bReceive) {
                if (MsgSettingSetBool(PUSH_RECV_OPTION, pushOpt.bReceive) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", PUSH_RECV_OPTION);
+                       MSG_ERR("Error to set config data [%s]", PUSH_RECV_OPTION);
                        return MSG_ERR_SET_SETTING;
                }
                g_pushMsgOpt.bReceive = pushOpt.bReceive;
@@ -785,7 +793,7 @@ msg_error_t MsgSetPushMsgOpt(const MSG_SETTING_S *pSetting)
 
        if (g_pushMsgOpt.serviceType != pushOpt.serviceType) {
                if (MsgSettingSetInt(PUSH_SERVICE_TYPE, (int)pushOpt.serviceType) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", PUSH_SERVICE_TYPE);
+                       MSG_ERR("Error to set config data [%s]", PUSH_SERVICE_TYPE);
                        return MSG_ERR_SET_SETTING;
                }
                g_pushMsgOpt.serviceType = pushOpt.serviceType;
@@ -830,7 +838,7 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
 #endif
                err = MsgSetConfigInSim(pSetting);
                if (err != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data in sim [%d]", err);
+                       MSG_ERR("Error to set config data in sim [%d]", err);
                        return err;
                }
        }
@@ -842,7 +850,7 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
 
        if (bValue != cbOpt.bReceive) {
                if (MsgSettingSetBool(keyName, cbOpt.bReceive) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", keyName);
+                       MSG_ERR("Error to set config data [%s]", keyName);
                        return MSG_ERR_SET_SETTING;
                }
        }
@@ -860,7 +868,7 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
        }
        if (iValue != cbOpt.maxSimCnt) {
                if (MsgSettingSetInt(keyName, cbOpt.maxSimCnt) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", keyName);
+                       MSG_ERR("Error to set config data [%s]", keyName);
                        return MSG_ERR_SET_SETTING;
                }
        }
@@ -878,7 +886,7 @@ msg_error_t MsgSetCBMsgOpt(const MSG_SETTING_S *pSetting, bool bSetSim)
                        snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
 
                        if (MsgSettingSetBool(keyName, cbOpt.bLanguage[i]) != MSG_SUCCESS) {
-                               MSG_DEBUG("Error to set config data [%s]", keyName);
+                               MSG_ERR("Error to set config data [%s]", keyName);
                                return MSG_ERR_SET_SETTING;
                        }
                }
@@ -954,7 +962,7 @@ msg_error_t MsgSetMsgSizeOpt(const MSG_SETTING_S *pSetting)
        }
        if (iValue != msgSizeOpt.nMsgSize) {
                if (MsgSettingSetInt(MSGSIZE_OPTION, msgSizeOpt.nMsgSize) != MSG_SUCCESS) {
-                       MSG_DEBUG("Error to set config data [%s]", MSGSIZE_OPTION);
+                       MSG_ERR("Error to set config data [%s]", MSGSIZE_OPTION);
                        return MSG_ERR_SET_SETTING;
                }
        }
@@ -1328,7 +1336,7 @@ msg_error_t MsgSetConfigInSim(const MSG_SETTING_S *pSetting)
                err = MSG_ERR_NULL_POINTER;
 
        if (err != MSG_SUCCESS) {
-               MSG_DEBUG("Error. Error code is %d.", err);
+               MSG_ERR("Error. Error code is %d.", err);
                return err;
        }
 
@@ -1349,7 +1357,7 @@ msg_error_t MsgGetConfigInSim(MSG_SETTING_S *pSetting)
                err = MSG_ERR_NULL_POINTER;
 
        if (err != MSG_SUCCESS) {
-               MSG_DEBUG("Error. Error code is %d.", err);
+               MSG_ERR("Error. Error code is %d.", err);
                return err;
        }
 
index 0dd43be..fd33ddb 100755 (executable)
@@ -35,7 +35,7 @@
 #include "MsgStorageHandler.h"
 
 #define MSG_DB_ACCESS_MAX_COUNT 10
-#define MSG_DB_VERSION 2
+#define MSG_DB_VERSION 3
 
 /*==================================================================================================
                                      VARIABLES
@@ -145,25 +145,41 @@ void MsgUpdateDBtoVer2()
 }
 
 
-void MsgStoUpdateDBVersion()
+void MsgUpdateDBtoVer3()
 {
        MsgDbHandler *dbHandle = getDbHandle();
-       char sqlQuery[MAX_QUERY_LEN+1];
+       msg_error_t err = MSG_SUCCESS;
+       char sqlQuery[MAX_QUERY_LEN+1] = {0};
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "PRAGMA user_version=%d;", MSG_DB_VERSION);
+       if (!dbHandle->checkTableExist(MSGFW_MMS_RECIPIENTS_TABLE_NAME)) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery),
+                               "CREATE TABLE %s ( "
+                               "MSG_ID INTEGER NOT NULL, "
+                               "ADDRESS_TYPE INTEGER DEFAULT 0, "
+                               "RECIPIENT_TYPE INTEGER DEFAULT 0, "
+                               "ADDRESS_VAL TEXT NOT NULL DEFAULT '', "
+                               "FOREIGN KEY(MSG_ID) REFERENCES MSG_MESSAGE_TABLE(MSG_ID));",
+                               MSGFW_MMS_RECIPIENTS_TABLE_NAME);
 
-       if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
-               MSG_DEBUG("Fail to prepareQuery.");
-               return;
-       }
+               err = dbHandle->execQuery(sqlQuery);
 
-       if (dbHandle->stepQuery() == MSG_ERR_DB_STEP) {
-               MSG_DEBUG("Fail to stepQuery.");
-               dbHandle->finalizeQuery();
-               return;
+               if (err == MSG_SUCCESS)
+                       MSG_SEC_DEBUG("SUCCESS : create %s.", MSGFW_MMS_RECIPIENTS_TABLE_NAME);
+               else
+                       MSG_SEC_DEBUG("FAIL : create %s [%d].", MSGFW_MMS_RECIPIENTS_TABLE_NAME, err);
        }
+}
 
-       dbHandle->finalizeQuery();
+
+void MsgStoUpdateDBVersion()
+{
+       MsgDbHandler *dbHandle = getDbHandle();
+       char sqlQuery[MAX_QUERY_LEN+1];
+
+       snprintf(sqlQuery, sizeof(sqlQuery), "PRAGMA user_version=%d;", MSG_DB_VERSION);
+       if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
+               MSG_DEBUG("Fail to execQuery.");
 }
 
 msg_error_t MsgStoDBVerCheck()
@@ -214,11 +230,14 @@ msg_error_t MsgStoDBVerCheck()
        case 1 :
                MsgUpdateDBtoVer2();
                /* no break */
-       default :
-               MsgStoUpdateDBVersion();
+       case 2 :
+               MsgUpdateDBtoVer3();
                /* no break */
        }
 
+       if (dbVersion < MSG_DB_VERSION)
+               MsgStoUpdateDBVersion();
+
        return MSG_SUCCESS;
 }
 
index ca7ea6b..b623b6c 100755 (executable)
@@ -966,6 +966,15 @@ msg_error_t MsgStoDeleteMessage(msg_message_id_t msgId, bool bCheckIndication)
 
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+                               MSGFW_MMS_RECIPIENTS_TABLE_NAME, msgId);
+
+               if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+                       dbHandle->endTrans(false);
+                       return MSG_ERR_DB_EXEC;
+               }
+
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
                                MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
 
                /* Delete Data from MMS table */
@@ -1061,12 +1070,13 @@ msg_error_t MsgStoDeleteAllMessageInFolder(msg_folder_id_t folderId, bool bOnlyD
                                                MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
                                                MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
                                                MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
-                                               MSGFW_UNIQUENESS_INFO_TABLE_NAME};
+                                               MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_UNIQUENESS_INFO_TABLE_NAME};
 #else
        const char *tableList[] = {MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
                                                MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
                                                MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
-                                               MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME};
+                                               MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
+                                               MSGFW_MMS_RECIPIENTS_TABLE_NAME};
 #endif
 
        int listCnt = sizeof(tableList)/sizeof(char *);
@@ -1403,13 +1413,14 @@ msg_error_t MsgStoDeleteMessageByList(msg_id_list_s *pMsgIdList)
                                                MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
                                                MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
                                                MSGFW_SMS_REPORT_TABLE_NAME, MSGFW_MMS_MULTIPART_TABLE_NAME,
-                                               MSGFW_UNIQUENESS_INFO_TABLE_NAME};
+                                               MSGFW_MMS_RECIPIENTS_TABLE_NAME, MSGFW_UNIQUENESS_INFO_TABLE_NAME};
 #else
        const char *tableList[] = {MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MMS_PREVIEW_TABLE_NAME,
                                                MSGFW_PUSH_MSG_TABLE_NAME, MSGFW_CB_MSG_TABLE_NAME,
                                                MSGFW_SYNCML_MSG_TABLE_NAME, MSGFW_SMS_SENDOPT_TABLE_NAME,
                                                MSGFW_REPORT_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
-                                               MSGFW_SMS_REPORT_TABLE_NAME, MSGFW_MMS_MULTIPART_TABLE_NAME};
+                                               MSGFW_SMS_REPORT_TABLE_NAME, MSGFW_MMS_MULTIPART_TABLE_NAME,
+                                               MSGFW_MMS_RECIPIENTS_TABLE_NAME};
 #endif
 
        int listCnt = sizeof(tableList)/sizeof(char *);
@@ -2132,10 +2143,6 @@ msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, M
 
        dbHandle->finalizeQuery();
 
-
-       /* get address information. */
-       MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
-
        /* Get MMS body if it is MMS. */
        if ((pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS &&
                        (pMsg->msgType.subType == MSG_RETRIEVE_MMS || pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)) ||
@@ -2197,6 +2204,12 @@ msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, M
                        delete [] pDestMsg;
                        pDestMsg = NULL;
                }
+               /* get recipients information. */
+               MsgStoGetRecipientsByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
+
+       } else {
+               /* get address information. */
+               MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
        }
 
        /* Get SMS Sending Options */
index 8d3f5ab..bce5b26 100755 (executable)
@@ -114,11 +114,6 @@ msg_error_t MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
                                return MSG_ERR_DB_PREPARE;
                        }
 
-//                     if (MsgOpenAndReadFile(pMsg->msgText, &pFileData, &fileSize) == false) {
-                       if (g_file_get_contents((gchar*)pMsg->msgText, (gchar**)&pFileData, &fileSize, NULL) == false) {
-                               return MSG_ERR_STORAGE_ERROR;
-                       }
-
                        dbHandle->bindText(pMsg->subject, 1);
 
                        if (pMsg->msgText[0] != '\0' && g_file_get_contents((gchar*)pMsg->msgText, (gchar**)&pFileData, &fileSize, NULL) == true) {
@@ -176,135 +171,21 @@ msg_error_t MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
        /* PLM P141008-05143  :  Notification.Ind address is 1, but MMS retreived Conf address is correct.
         * So adding code for comparing exist address and new address and replace with new address(MMSconf) address */
 
-       if(pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS) {
+       if ((pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS)
+               && (pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)) {
                if (pMsg->addressList) {
-                       if (pMsg->nAddressCnt == 1) {
-                               char tmpAddressVal[MAX_ADDRESS_VAL_LEN+1] = {0, };
-                               msg_address_type_t tmpAddressType;
-                               msg_recipient_type_t tmpRecipientType;
-                               int tmpConvId;
-
-                               /* compare stored address and currnt address */
-                               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-                               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT "
-                                               "A.CONV_ID, "
-                                               "A.ADDRESS_TYPE, "
-                                               "A.RECIPIENT_TYPE, "
-                                               "A.ADDRESS_VAL "
-                                               "FROM %s A, %s B "
-                                               "WHERE A.CONV_ID = B.CONV_ID "
-                                               "AND B.MSG_ID = %d;",
-                                               MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME,
-                                               pMsg->msgId);
-
-                               MSG_DEBUG("[%s]", sqlQuery);
-
-                               if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                       return MSG_ERR_DB_PREPARE;
-                               }
-
-                               err = dbHandle->stepQuery();
-
-                               if (err == MSG_ERR_DB_ROW) {
-                                       tmpConvId = dbHandle->columnInt(0);
-                                       tmpAddressType = dbHandle->columnInt(1);
-                                       tmpRecipientType = dbHandle->columnInt(2);
-                                       strncpy(tmpAddressVal, (char*)dbHandle->columnText(3), MAX_ADDRESS_VAL_LEN);
-
-                                       dbHandle->finalizeQuery();
-
-                                       /* compare stored addressList and current addressList */
-                                       if (tmpAddressType != pMsg->addressList->addressType ||
-                                               tmpRecipientType != pMsg->addressList->recipientType ||
-                                               (strncmp(tmpAddressVal, pMsg->addressList->addressVal, MAX_ADDRESS_VAL_LEN) != 0)) {
-                                               MSG_WARN("AddressList of NotiInd and MMSConf are different!!, Replace AddressList to MMSConf data");
-                                               MSG_WARN("AddType [NotiInd : %d], [MMSConf : %d]", tmpAddressType, pMsg->addressList->addressType);
-                                               MSG_WARN("RcptType [NotiInd : %d], [MMSConf : %d]", tmpRecipientType, pMsg->addressList->recipientType);
-                                               MSG_SEC_INFO("AddressVal [NotiInd : %s], [MMSConf : %s]", tmpAddressVal, pMsg->addressList->addressVal);
-
-                                               /* If MMSConf AddressList is already exist, Replace exist ConvId with matching msgId */
-                                               memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-                                               snprintf(sqlQuery, sizeof(sqlQuery),
-                                                       "SELECT CONV_ID FROM %s WHERE ADDRESS_VAL = '%s'",
-                                                       MSGFW_ADDRESS_TABLE_NAME, pMsg->addressList->addressVal);
-
-                                               MSG_DEBUG("[%s]", sqlQuery);
-
-                                               if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                                       return MSG_ERR_DB_PREPARE;
-                                               }
-
-                                               err = dbHandle->stepQuery();
-
-                                               if (err == MSG_ERR_DB_ROW) {
-                                                       tmpConvId = dbHandle->columnInt(0);
-
-                                                       dbHandle->finalizeQuery();
-
-                                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-                                                       snprintf(sqlQuery, sizeof(sqlQuery),
-                                                               "UPDATE %s SET CONV_ID = %d WHERE MSG_ID = %d;",
-                                                               MSGFW_MESSAGE_TABLE_NAME, tmpConvId, pMsg->msgId);
+                       msg_thread_id_t conv_id = 0;
+                       msg_thread_id_t prev_conv_id = MsgGetThreadId(dbHandle, pMsg->msgId);
 
-                                                       MSG_DEBUG("[%s]", sqlQuery);
-
-                                                       if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                                               return MSG_ERR_DB_PREPARE;
-                                                       }
-
-                                                       err = dbHandle->stepQuery();
-
-                                                       if (err != MSG_ERR_DB_DONE) {
-                                                               dbHandle->finalizeQuery();
-                                                               MSG_ERR("Replacing CONV_ID with exist one. Fail.");
-                                                               return MSG_ERR_DB_STEP;
-                                                       }
-
-                                                       dbHandle->finalizeQuery();
-                                               } else {
-                                                       dbHandle->finalizeQuery();
-
-                                                       memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
-                                                       snprintf(sqlQuery, sizeof(sqlQuery),
-                                                               "UPDATE %s SET ADDRESS_TYPE = %d, RECIPIENT_TYPE = %d, ADDRESS_VAL = '%s' WHERE CONV_ID = %d;",
-                                                               MSGFW_ADDRESS_TABLE_NAME, pMsg->addressList->addressType, pMsg->addressList->recipientType, pMsg->addressList->addressVal, tmpConvId);
-
-                                                       MSG_DEBUG("[%s]", sqlQuery);
-
-                                                       if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
-                                                               return MSG_ERR_DB_PREPARE;
-                                                       }
-
-                                                       err = dbHandle->stepQuery();
-
-                                                       if (err != MSG_ERR_DB_DONE) {
-                                                               dbHandle->finalizeQuery();
-                                                               MSG_ERR("Replacing Address with MMSConf Address. Fail.");
-                                                               return MSG_ERR_DB_STEP;
-                                                       }
-
-                                                       dbHandle->finalizeQuery();
-                                               }
-                                       }
-                               } else {
-                                       dbHandle->finalizeQuery();
-                                       return MSG_ERR_DB_STEP;
-                               }
-                       } else if (pMsg->nAddressCnt > 1) {
-                               msg_thread_id_t conv_id = 0;
-                               msg_thread_id_t prev_conv_id = MsgGetThreadId(dbHandle, pMsg->msgId);
-
-                               err = MsgStoAddAddress(dbHandle, pMsg, &conv_id);
-                               if (err != MSG_SUCCESS) {
-                                       MSG_ERR("MsgStoAddAddress is failed");
-                                       return err;
-                               }
-                               pMsg->threadId = conv_id;
+                       err = MsgStoAddAddress(dbHandle, pMsg, &conv_id);
+                       if (err != MSG_SUCCESS) {
+                               MSG_ERR("MsgStoAddAddress is failed");
+                               return err;
+                       }
+                       pMsg->threadId = conv_id;
 
+                       MSG_DEBUG("prev_conv_id[%d] conv_id[%d]", prev_conv_id, conv_id);
+                       if (prev_conv_id != 0 && prev_conv_id != conv_id) {
                                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                                snprintf(sqlQuery, sizeof(sqlQuery),
                                        "UPDATE %s SET CONV_ID = %d WHERE MSG_ID = %d;",
@@ -316,20 +197,17 @@ msg_error_t MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
                                        return err;
                                }
 
-                               MSG_DEBUG("prev_conv_id[%d] conv_id[%d]", prev_conv_id, conv_id);
-                               if (prev_conv_id != 0 && prev_conv_id != conv_id) {
-                                       if (MsgStoUpdateConversation(dbHandle, prev_conv_id) != MSG_SUCCESS) {
-                                               MSG_DEBUG("MsgStoUpdateConversation() Error");
-                                               return MSG_ERR_STORAGE_ERROR;
-                                       }
+                               if (MsgStoUpdateConversation(dbHandle, prev_conv_id) != MSG_SUCCESS) {
+                                       MSG_ERR("MsgStoUpdateConversation() Error");
+                                       return MSG_ERR_STORAGE_ERROR;
+                               }
 
-                                       if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
-                                               MSG_DEBUG("MsgStoClearConversationTable() Error");
-                                       }
+                               if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
+                                       MSG_ERR("MsgStoClearConversationTable() Error");
+                               }
 
-                                       if (MsgExistInThreadViewList(dbHandle, prev_conv_id) == false) {
-                                               MsgTransactionManager::instance()->broadcastThreadChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_DELETE, prev_conv_id);
-                                       }
+                               if (MsgExistInThreadViewList(dbHandle, prev_conv_id) == false) {
+                                       MsgTransactionManager::instance()->broadcastThreadChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_DELETE, prev_conv_id);
                                }
                        }
                }
@@ -341,14 +219,12 @@ msg_error_t MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
 
        if (convId > 0) {
                if (MsgStoUpdateConversation(dbHandle, convId) != MSG_SUCCESS) {
-                       MSG_DEBUG("MsgStoUpdateConversation() Error");
-                       dbHandle->freeTable();
-
+                       MSG_ERR("MsgStoUpdateConversation() Error");
                        return MSG_ERR_STORAGE_ERROR;
                }
 
                if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
-                       MSG_DEBUG("MsgStoClearConversationTable() Error");
+                       MSG_ERR("MsgStoClearConversationTable() Error");
                }
        } else {
                return MSG_ERR_DB_STEP;
index 63c5feb..0c8b63b 100755 (executable)
@@ -616,16 +616,32 @@ int MsgIncomingMMSConfMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
        msgIds[0] = msgInfo.msgId;
        msgIdList.msgIdList = msgIds;
 
+       bool is_group_on = false;
+       if (MsgSettingGetBool(MMS_RECV_GROUP_MESSAGE, &is_group_on) != MSG_SUCCESS) {
+               MSG_INFO("MsgSettingGetBool() is failed");
+       }
+
+       MSG_INFO("Group Message Setting Value [%d]", is_group_on);
+
        MsgDbHandler *dbHandle = getDbHandle();
        int tmpAddrCnt = 0;
        MSG_ADDRESS_INFO_S *tmpAddr = NULL;
        err = MsgStoGetAddressByMsgId(dbHandle, msgInfo.msgId, &tmpAddrCnt, &tmpAddr);
        if (err != MSG_SUCCESS) {
-               MSG_DEBUG("MsgStoGetAddressByMsgId() fail.");
+               MSG_WARN("MsgStoGetAddressByMsgId() fail.");
        }
 
        if (msgInfo.msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || msgInfo.msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS) {
-               if (msgInfo.networkStatus != MSG_NETWORK_RETRIEVE_SUCCESS) {
+               /* PLM P141008-05143 & P150710-01521 : Notification.Ind address and MMS retreived Conf address are different.
+                   Replace Notification.Ind address with MMS retreived Conf address if and only if MMS retreived Conf address is a valid address not junk*/
+               if (msgInfo.networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS && g_strcmp0(tmpAddr->addressVal, msgInfo.addressList[0].addressVal) != 0) {
+                       MSG_WARN("Address of NotiInd and MMSConf are different!!, Replace [NotiInd address: %s] from [MMSConf address: %s]", tmpAddr->addressVal, msgInfo.addressList[0].addressVal);
+                       memset(tmpAddr[0].addressVal, 0x00, MAX_ADDRESS_VAL_LEN);
+                       strncpy(tmpAddr[0].addressVal, msgInfo.addressList[0].addressVal, MAX_ADDRESS_VAL_LEN);
+                       tmpAddr[0].addressType = msgInfo.addressList[0].addressType;
+               }
+
+               if (is_group_on == false || msgInfo.networkStatus != MSG_NETWORK_RETRIEVE_SUCCESS) {
                        if (msgInfo.addressList) {
                                delete[] msgInfo.addressList;
                                msgInfo.addressList = NULL;
index 32108ae..1a45ff6 100755 (executable)
 #define MMS_RECV_DELIVERY_RECEIPT      DEFAULT_MMS_RECV_OPT_PATH"/delivery_receipt"
 #define MMS_RECV_REJECT_UNKNOWN                DEFAULT_MMS_RECV_OPT_PATH"/reject_unknown"
 #define MMS_RECV_REJECT_ADVERTISE      DEFAULT_MMS_RECV_OPT_PATH"/reject_advertisement"
+#define MMS_RECV_GROUP_MESSAGE                         DEFAULT_MMS_RECV_OPT_PATH"/group_message"
 
 #define MMS_STYLE_FONT_SIZE                                                    DEFAULT_MMS_STYLE_OPT_PATH"/font_size"
 #define MMS_STYLE_FONT_STYLE_BOLD                      DEFAULT_MMS_STYLE_OPT_PATH"/font_style/bold"
index 6ff8fdf..e13308e 100755 (executable)
@@ -329,6 +329,7 @@ typedef struct {
        bool                            bDeliveryReceipt;                       /**< Indicates whether the delivery report will be sent or not. */
        bool                            bRejectUnknown;                 /**< Indicates whether unknown addresses are rejected or not. */
        bool                            bRejectAdvertisement;   /**< Indicates whether advertisement is rejected or not. */
+       bool                            bGroupMessage;                  /**< Indicates whether group message option is enable or not. */
 } MSG_MMS_RECVOPT_S;
 
 
index c1bff4f..b37f950 100755 (executable)
@@ -708,7 +708,8 @@ enum _MSG_STRUCT_MMS_RECV_OPT_E {
        MSG_MMS_RECVOPT_READ_REPORT_BOOL,                                           /**< Indicates whether the read report will be sent or not. */
        MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL,                                       /**< Indicates whether the delivery report will be sent or not. */
        MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL,                                        /**< Indicates whether unknown addresses are rejected or not. */
-       MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL                                   /**< Indicates whether advertisement is rejected or not. */
+       MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL,                                  /**< Indicates whether advertisement is rejected or not. */
+       MSG_MMS_RECVOPT_GROUP_MESSAGE_BOOL,                                         /**< Indicates whether group message option is enable or not. */
 };
 
 /**
@@ -726,7 +727,7 @@ enum _MSG_STRUCT_GENERAL_OPT_E {
        MSG_GENERAL_MSG_VIBRATION_BOOL,                                 /**< Indicates whether vibration for incoming message is run or not. */
        MSG_GENERAL_MSG_PREVIEW_BOOL,                                   /**< Indicates whether preview for incoming message is shown or not. */
        MSG_GENERAL_RINGTONE_TYPE_INT,                                  /**< Indicates the message ringtone type. See enum _MSG_RINGTONE_TYPE_E */
-       MSG_GENERAL_RINGTONE_PATH_STR                                   /**< Indicates the message ringtone path */
+       MSG_GENERAL_RINGTONE_PATH_STR,                                  /**< Indicates the message ringtone path */
 };
 
 /**
index 3eb9e05..11a4ae9 100755 (executable)
@@ -55,6 +55,7 @@
 #define MSGFW_PUSH_CONFIG_TABLE_NAME           "MSG_PUSHCFG_TABLE"
 #define MSGFW_MMS_PREVIEW_TABLE_NAME           "MSG_MMS_PREVIEW_INFO_TABLE"
 #define MSGFW_MMS_MULTIPART_TABLE_NAME         "MSG_MULTIPART_TABLE"
+#define MSGFW_MMS_RECIPIENTS_TABLE_NAME        "MSG_MMS_RECIPIENTS_TABLE"
 
 #ifdef FEATURE_SMS_CDMA
 #define MSGFW_UNIQUENESS_INFO_TABLE_NAME       "MSG_UNIQUENESS_INFO_TABLE"
index 9a7dff5..b5a3083 100755 (executable)
@@ -41,6 +41,7 @@ int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t F
 msg_error_t MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId);
 msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int *nAddressCnt, MSG_ADDRESS_INFO_S **pAddress);
 msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, msg_struct_list_s *pAddress);
+msg_error_t MsgStoGetRecipientsByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int *nAddressCnt, MSG_ADDRESS_INFO_S **pAddress);
 msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t convId, msg_struct_list_s *pAddrlist);
 void MsgStoUpdateAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t convId);
 msg_error_t MsgStoAddConversation(MsgDbHandler *pDbHandle, msg_thread_id_t *pConvId);
index dd9075e..594f0cd 100755 (executable)
@@ -1282,6 +1282,9 @@ int msg_get_mms_recv_opt_bool(void *mms_recv_opt, int field, bool *value)
        case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL:
                *value = recv_opt->bRejectAdvertisement;
                break;
+       case MSG_MMS_RECVOPT_GROUP_MESSAGE_BOOL:
+               *value = recv_opt->bGroupMessage;
+               break;
        default:
                ret = MSG_ERR_INVALID_PARAMETER;
                break;
@@ -1312,6 +1315,9 @@ int msg_set_mms_recv_opt_bool(void *mms_recv_opt, int field, bool value)
        case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL:
                recv_opt->bRejectAdvertisement = value;
                break;
+       case MSG_MMS_RECVOPT_GROUP_MESSAGE_BOOL:
+               recv_opt->bGroupMessage = value;
+               break;
        default:
                ret = MSG_ERR_INVALID_PARAMETER;
                break;
index 60e8a16..299e57e 100755 (executable)
@@ -604,50 +604,53 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra
        if (msisdn)
                normal_msisdn = msg_normalize_number(msisdn);
 
-       /* get setting value of group message */
-       bool is_group_on = false;
-
-       if (is_group_on) {
-               int addr_cnt = 0;
-               MsgHeaderAddress *iter = NULL;
+       int addr_cnt = 0;
+       int recipients_cnt = 0;
+       MsgHeaderAddress *iter = NULL;
+
+       iter = mmsHeader.pFrom;
+       while (iter) {
+               MmsAddrUtilRemovePlmnString(iter->szAddr);
+               recipients_cnt++;
+               addr_cnt++;
+               iter = iter->pNext;
+       }
 
-               iter = mmsHeader.pFrom;
-               while (iter) {
+       iter = mmsHeader.pTo;
+       while (iter) {
+               MmsAddrUtilRemovePlmnString(iter->szAddr);
+               recipients_cnt++;
+               if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn))
                        addr_cnt++;
-                       iter = iter->pNext;
-               }
+               iter = iter->pNext;
+       }
 
-               iter = mmsHeader.pTo;
-               while (iter) {
-                       if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn))
-                               addr_cnt++;
-                       iter = iter->pNext;
-               }
+       iter = mmsHeader.pCc;
+       while (iter) {
+               MmsAddrUtilRemovePlmnString(iter->szAddr);
+               recipients_cnt++;
+               if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn))
+                       addr_cnt++;
+               iter = iter->pNext;
+       }
 
-               iter = mmsHeader.pCc;
-               while (iter) {
-                       if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn))
-                               addr_cnt++;
-                       iter = iter->pNext;
-               }
+       MSG_ADDRESS_INFO_S *recipients_addr_info = NULL;
+       if (recipients_cnt > 0) {
+               recipients_addr_info = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)*recipients_cnt];
+               memset(recipients_addr_info, 0x00, sizeof(MSG_ADDRESS_INFO_S)*recipients_cnt);
+       }
 
-               MSG_ADDRESS_INFO_S *tmp_addr_info = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)*addr_cnt];
+       MSG_ADDRESS_INFO_S *tmp_addr_info = NULL;
+       if (addr_cnt > 0) {
+               tmp_addr_info = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)*addr_cnt];
                memset(tmp_addr_info, 0x00, sizeof(MSG_ADDRESS_INFO_S)*addr_cnt);
-               if (mmsHeader.pFrom == NULL) {
-                       strncpy(tmp_addr_info[0].addressVal, pMsgInfo->addressList[0].addressVal, MAX_ADDRESS_VAL_LEN);
-               }
-
-               pMsgInfo->nAddressCnt = addr_cnt;
-               pMsgInfo->addressList = tmp_addr_info;
-       } else {
-               pMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S)];
-               memset(pMsgInfo->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S));
-               pMsgInfo->nAddressCnt = 1;
        }
 
+       pMsgInfo->nAddressCnt = addr_cnt;
+       pMsgInfo->addressList = tmp_addr_info;
+
        if (mmsHeader.pFrom) {
                MSG_DEBUG("FROM : [%s]", mmsHeader.pFrom->szAddr);
-               MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
                /* From */
                strncpy(pMsgInfo->addressList[0].addressVal, mmsHeader.pFrom->szAddr, MAX_ADDRESS_VAL_LEN);
                if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[0].addressVal)) {
@@ -655,54 +658,76 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra
                } else {
                        pMsgInfo->addressList[0].addressType = MSG_ADDRESS_TYPE_PLMN;
                }
+
+               strncpy(recipients_addr_info[0].addressVal, mmsHeader.pFrom->szAddr, MAX_ADDRESS_VAL_LEN);
+               if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[0].addressVal)) {
+                       recipients_addr_info[0].addressType = MSG_ADDRESS_TYPE_EMAIL;
+               } else {
+                       recipients_addr_info[0].addressType = MSG_ADDRESS_TYPE_PLMN;
+               }
        }
 
-       if (is_group_on) {
-               int addr_idx = 0;
-               if (mmsHeader.pTo) {
-                       MsgHeaderAddress *iter = mmsHeader.pTo;
-                       while (iter) {
-                               addr_idx++;
-                               MSG_DEBUG("TO : [%s]", mmsHeader.pTo->szAddr);
-                               MmsAddrUtilRemovePlmnString(iter->szAddr);
-                               /* To */
-                               if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
-                                       strncpy(pMsgInfo->addressList[addr_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
-                                       pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_TO;
-                                       if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
-                                               pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
-                                       } else {
-                                               pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
-                                       }
+       int addr_idx = 0;
+       int recipients_idx = 0;
+       if (mmsHeader.pTo) {
+               MsgHeaderAddress *iter = mmsHeader.pTo;
+               while (iter) {
+                       addr_idx++;
+                       MSG_DEBUG("TO : [%s]", mmsHeader.pTo->szAddr);
+                       /* To */
+                       if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
+                               strncpy(pMsgInfo->addressList[addr_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
+                               pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_TO;
+                               if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
+                                       pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
                                } else {
-                                       addr_idx--;
+                                       pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
                                }
+                       } else {
+                               addr_idx--;
+                       }
 
-                               iter = iter->pNext;
+                       recipients_idx++;
+                       strncpy(recipients_addr_info[recipients_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
+                       recipients_addr_info[recipients_idx].recipientType = MSG_RECIPIENTS_TYPE_TO;
+                       if (MmsAddrUtilCheckEmailAddress(recipients_addr_info[recipients_idx].addressVal)) {
+                               recipients_addr_info[recipients_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
+                       } else {
+                               recipients_addr_info[recipients_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
                        }
+
+                       iter = iter->pNext;
                }
+       }
 
-               if (mmsHeader.pCc) {
-                       MsgHeaderAddress *iter = mmsHeader.pCc;
-                       while (iter) {
-                               addr_idx++;
-                               MSG_DEBUG("CC : [%s]", mmsHeader.pCc->szAddr);
-                               MmsAddrUtilRemovePlmnString(iter->szAddr);
-                               /* Cc */
-                               if (normal_msisdn == NULL || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
-                                       strncpy(pMsgInfo->addressList[addr_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
-                                       pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_CC;
-                                       if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
-                                               pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
-                                       } else {
-                                               pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
-                                       }
+       if (mmsHeader.pCc) {
+               MsgHeaderAddress *iter = mmsHeader.pCc;
+               while (iter) {
+                       addr_idx++;
+                       MSG_DEBUG("CC : [%s]", mmsHeader.pCc->szAddr);
+                       /* Cc */
+                       if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
+                               strncpy(pMsgInfo->addressList[addr_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
+                               pMsgInfo->addressList[addr_idx].recipientType = MSG_RECIPIENTS_TYPE_CC;
+                               if (MmsAddrUtilCheckEmailAddress(pMsgInfo->addressList[addr_idx].addressVal)) {
+                                       pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
                                } else {
-                                       addr_idx--;
+                                       pMsgInfo->addressList[addr_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
                                }
+                       } else {
+                               addr_idx--;
+                       }
 
-                               iter = iter->pNext;
+                       recipients_idx++;
+                       strncpy(recipients_addr_info[recipients_idx].addressVal, iter->szAddr, MAX_ADDRESS_VAL_LEN);
+                       recipients_addr_info[recipients_idx].recipientType = MSG_RECIPIENTS_TYPE_CC;
+                       if (MmsAddrUtilCheckEmailAddress(recipients_addr_info[recipients_idx].addressVal)) {
+                               recipients_addr_info[recipients_idx].addressType = MSG_ADDRESS_TYPE_EMAIL;
+                       } else {
+                               recipients_addr_info[recipients_idx].addressType = MSG_ADDRESS_TYPE_PLMN;
                        }
+
+                       iter = iter->pNext;
                }
        }
 
@@ -758,9 +783,13 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra
 
        MmsPluginStorage *pStorage = MmsPluginStorage::instance();
 
+       err = pStorage->insertRecipientsInfo(pMsgInfo->msgId, recipients_addr_info, recipients_cnt);
+
+       MSG_DEBUG("Result of insertRecipientsInfo [%d]", err);
+
        err = pStorage->updateMmsAttrib(pMsgInfo->msgId, &attrib, pMsgInfo->msgType.subType);
 
-       MSG_DEBUG("Error value of updateMmsAttrib [%d]", err);
+       MSG_DEBUG("Result of updateMmsAttrib [%d]", err);
 
        /* make MmsData & insert multipart */
        MMSList *multipart_list = NULL;
@@ -774,7 +803,7 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra
 
        MMS_DATA_S *pMmsData = MsgMmsCreate();
        if (pMmsData == NULL) {
-               MSG_SEC_DEBUG("Fail to create mms");
+               MSG_SEC_ERR("Fail to create mms");
                goto __CATCH;
        }
 
@@ -814,7 +843,7 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra
        MsgMmsRelease(&pMmsData);
 
        if (MsgGetFileSize(pRetrievedFilePath, (int *)&pMsgInfo->dataSize) == false) {
-               MSG_SEC_DEBUG("Fail to get mms file size [%s]", pRetrievedFilePath);
+               MSG_SEC_ERR("Fail to get mms file size [%s]", pRetrievedFilePath);
                goto __CATCH;
        }
 
@@ -825,6 +854,10 @@ __CATCH: {
                MmsReleaseMsgDRMInfo(&pMsg->msgType.drmInfo);
                MmsReleaseMsgBody(&pMsg->msgBody, pMsg->msgType.type);
                g_free(filename); filename = NULL;
+               if (recipients_addr_info) {
+                       delete [] recipients_addr_info;
+                       recipients_addr_info = NULL;
+               }
        }
        MSG_END();
 }
index 9b01f38..f77d63a 100755 (executable)
@@ -1620,3 +1620,35 @@ int MmsPluginStorage::checkDuplicateNotification(char* pszTrID, char* pszContent
        return msgId;
 }
 
+
+msg_error_t MmsPluginStorage::insertRecipientsInfo(msg_message_id_t msgId, MSG_ADDRESS_INFO_S *pAddrInfo, int addrCnt)
+{
+       MSG_BEGIN();
+       msg_error_t err = MSG_SUCCESS;
+       MsgDbHandler *dbHandle = getDbHandle();
+       char sqlQuery[MAX_QUERY_LEN + 1];
+
+       if (pAddrInfo == NULL)
+               return MSG_ERR_INVALID_PARAMETER;
+
+       MSG_DEBUG("Recipients Count [%d]", addrCnt);
+
+       dbHandle->beginTrans();
+
+       for (int i = 0; i < addrCnt; i++) {
+               memset(sqlQuery, 0x00, sizeof(sqlQuery));
+               snprintf(sqlQuery, MAX_QUERY_LEN, "INSERT INTO %s(MSG_ID, ADDRESS_TYPE, RECIPIENT_TYPE, ADDRESS_VAL) VALUES (%d, %d, %d, '%s');",
+                               MSGFW_MMS_RECIPIENTS_TABLE_NAME, msgId, pAddrInfo[i].addressType, pAddrInfo[i].recipientType, pAddrInfo[i].addressVal);
+
+               err = dbHandle->execQuery(sqlQuery);
+               if (err != MSG_SUCCESS) {
+                       dbHandle->endTrans(false);
+                       return err;
+               }
+       }
+
+       dbHandle->endTrans(true);
+
+       MSG_END();
+       return MSG_SUCCESS;
+}
index c260c47..1f5f67a 100755 (executable)
@@ -73,6 +73,8 @@ public:
 
        int checkDuplicateNotification(char* pszTrID, char* pszContentLocation);
 
+       msg_error_t insertRecipientsInfo(msg_message_id_t msgId, MSG_ADDRESS_INFO_S *pAddrInfo, int addrCnt);
+
 private:
        void getMmsFromDB(msg_message_id_t msgId, MmsMsg *pMmsMsg);
        msg_error_t addMmsMsgToDB(MmsMsg *pMmsMsg, const char *raw_filepath);
index 5f8b539..f5c2e49 100755 (executable)
@@ -576,6 +576,48 @@ msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t ms
 }
 
 
+msg_error_t MsgStoGetRecipientsByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int *nAddressCnt, MSG_ADDRESS_INFO_S **pAddress)
+{
+       char sqlQuery[MAX_QUERY_LEN+1];
+       int rowCnt = 0, index = 0;
+
+       *nAddressCnt = 0;
+
+       memset(sqlQuery, 0x00, sizeof(sqlQuery));
+       snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_TYPE, RECIPIENT_TYPE, ADDRESS_VAL FROM %s WHERE MSG_ID = %d;",
+                       MSGFW_MMS_RECIPIENTS_TABLE_NAME, msgId);
+
+       msg_error_t err = pDbHandle->getTable(sqlQuery, &rowCnt, &index);
+
+       if (err == MSG_ERR_DB_NORECORD) {
+               pDbHandle->freeTable();
+               return MSG_SUCCESS;
+       } else if (err != MSG_SUCCESS) {
+               MSG_DEBUG("Fail to getTable().");
+               pDbHandle->freeTable();
+               return err;
+       }
+
+       *nAddressCnt = rowCnt;
+
+       MSG_DEBUG("*nAddressCnt [%d]", *nAddressCnt);
+
+       MSG_ADDRESS_INFO_S *tmpAddressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * rowCnt];
+       memset(tmpAddressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * rowCnt);
+       *pAddress = tmpAddressList;
+
+       for (int i = 0; i < rowCnt; i++) {
+               tmpAddressList[i].addressType = pDbHandle->getColumnToInt(index++);
+               tmpAddressList[i].recipientType = pDbHandle->getColumnToInt(index++);
+               pDbHandle->getColumnToString(index++, MAX_ADDRESS_VAL_LEN, tmpAddressList[i].addressVal);
+               strncpy(tmpAddressList[i].displayName, tmpAddressList[i].addressVal, MAX_DISPLAY_NAME_LEN);
+       }
+       pDbHandle->freeTable();
+
+       return MSG_SUCCESS;
+}
+
+
 msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t convId, msg_struct_list_s *pAddrlist)
 {
        char sqlQuery[MAX_QUERY_LEN+1];