-PRAGMA user_version=2;
+PRAGMA user_version=3;
CREATE TABLE MSG_CONVERSATION_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 ,
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;
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;
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;
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;
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;
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;
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;
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;
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;
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));
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;
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;
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;
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;
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;
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;
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;
}
}
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
}
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
#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;
}
}
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;
}
}
}
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;
}
}
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;
}
}
}
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;
}
}
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;
}
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;
}
#include "MsgStorageHandler.h"
#define MSG_DB_ACCESS_MAX_COUNT 10
-#define MSG_DB_VERSION 2
+#define MSG_DB_VERSION 3
/*==================================================================================================
VARIABLES
}
-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()
case 1 :
MsgUpdateDBtoVer2();
/* no break */
- default :
- MsgStoUpdateDBVersion();
+ case 2 :
+ MsgUpdateDBtoVer3();
/* no break */
}
+ if (dbVersion < MSG_DB_VERSION)
+ MsgStoUpdateDBVersion();
+
return MSG_SUCCESS;
}
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 */
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 *);
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 *);
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)) ||
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 */
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) {
/* 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;",
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);
}
}
}
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;
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;
#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"
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;
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. */
};
/**
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 */
};
/**
#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"
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);
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;
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;
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)) {
} 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;
}
}
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;
MMS_DATA_S *pMmsData = MsgMmsCreate();
if (pMmsData == NULL) {
- MSG_SEC_DEBUG("Fail to create mms");
+ MSG_SEC_ERR("Fail to create mms");
goto __CATCH;
}
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;
}
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();
}
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;
+}
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);
}
+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];