g_mmsRecvOpt.bRejectAdvertisement = recvOpt.bRejectAdvertisement;
}
- if (g_mmsRecvOpt.bGroupMessage != recvOpt.bGroupMessage) {
- if (MsgSettingSetInt(MMS_RECV_GROUP_MESSAGE, recvOpt.bGroupMessage) != MSG_SUCCESS) {
+ if (g_mmsRecvOpt.groupMessage != recvOpt.groupMessage) {
+ if (MsgSettingSetInt(MMS_RECV_GROUP_MESSAGE, recvOpt.groupMessage) != MSG_SUCCESS) {
MSG_ERR("Error to set config data [%s]", MMS_RECV_GROUP_MESSAGE);
return MSG_ERR_SET_SETTING;
}
- g_mmsRecvOpt.bGroupMessage = recvOpt.bGroupMessage;
+ g_mmsRecvOpt.groupMessage = recvOpt.groupMessage;
}
return MSG_SUCCESS;
if (MsgSettingGetInt(MMS_RECV_GROUP_MESSAGE, &tmpVal) != MSG_SUCCESS)
MSG_INFO("MsgSettingGetInt() is failed");
- pSetting->option.mmsRecvOpt.bGroupMessage = (MSG_MMS_GROUP_MESSAGE_MODE_T)tmpVal;
+
+ if (tmpVal < 0)
+ tmpVal = MSG_GROUP_MESSAGE_NOT_AVAILABLE;
+
+ pSetting->option.mmsRecvOpt.groupMessage = (MSG_MMS_GROUP_MESSAGE_MODE_T)tmpVal;
}
dbHandle->finalizeQuery();
-#if 0 /* This block will be activated after find way to get own number with any SIMs */
if (pMsg->msgType.mainType == MSG_MMS_TYPE && pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS) {
/* get recipients information. */
MsgStoGetRecipientsByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
/* get address information. */
MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
}
-#else
- /* get address information. */
- MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
-#endif
+
/* 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)) ||
msgIds[0] = msgInfo.msgId;
msgIdList.msgIdList = msgIds;
- bool is_group_on = false;
- if (MsgSettingGetBool(MMS_RECV_GROUP_MESSAGE, &is_group_on) != MSG_SUCCESS) {
+ int groupMsg;
+ if (MsgSettingGetInt(MMS_RECV_GROUP_MESSAGE, &groupMsg) != MSG_SUCCESS) {
MSG_INFO("MsgSettingGetBool() is failed");
}
- MSG_INFO("Group Message Setting Value [%d]", is_group_on);
+ MSG_INFO("Group Message Setting Value [%d]", groupMsg);
MsgDbHandler *dbHandle = getDbHandle();
int tmpAddrCnt = 0;
tmpAddr[0].addressType = msgInfo.addressList[0].addressType;
}
- if (is_group_on == false || msgInfo.networkStatus != MSG_NETWORK_RETRIEVE_SUCCESS) {
+ if (groupMsg != MSG_GROUP_MESSAGE_ON || msgInfo.networkStatus != MSG_NETWORK_RETRIEVE_SUCCESS) {
if (msgInfo.addressList) {
delete[] msgInfo.addressList;
msgInfo.addressList = NULL;
/* pMsgInfo->msgType.subType = MSG_NOTIFICATIONIND_MMS; */
}
- char keyName[MAX_VCONFKEY_NAME_LEN];
- memset(keyName, 0x00, sizeof(keyName));
-
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0};
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_MSISDN, pMsgInfo->sim_idx);
char *msisdn = NULL;
if (MsgSettingGetString(keyName, &msisdn) != MSG_SUCCESS) {
if (msisdn)
normal_msisdn = msg_normalize_number(msisdn);
+ int groupMsg = 0;
+ if (MsgSettingGetInt(MMS_RECV_GROUP_MESSAGE, &groupMsg) != MSG_SUCCESS)
+ MSG_INFO("MsgSettingGetInt() is failed");
+ bool disabled_group_msg = groupMsg < MSG_GROUP_MESSAGE_OFF ? true : false;
+
int addr_cnt = 0;
int recipients_cnt = 0;
MsgHeaderAddress *iter = NULL;
addr_cnt++;
iter = iter->pNext;
}
-#if 0 /* This block will be activated after find way to get own number with any SIMs */
- 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 = 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;
+ /* If group message feature is available, parse to, cc */
+ if (!disabled_group_msg) {
+ 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 = 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;
+ }
}
-#endif
+
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];
__fillAddressInfo(&(pMsgInfo->addressList[0]), mmsHeader.pFrom->szAddr, MSG_RECIPIENTS_TYPE_UNKNOWN);
__fillAddressInfo(&recipients_addr_info[0], mmsHeader.pFrom->szAddr, MSG_RECIPIENTS_TYPE_UNKNOWN);
}
-#if 0 /* This block will be activated after find way to get own number with any SIMs */
- int addr_idx = 0;
- int recipients_idx = 0;
- if (mmsHeader.pTo) {
- MsgHeaderAddress *iter = mmsHeader.pTo;
- while (iter) {
- MSG_DEBUG("TO : [%s]", iter->szAddr);
- /* To */
- if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
- __fillAddressInfo(&(pMsgInfo->addressList[++addr_idx]), iter->szAddr, MSG_RECIPIENTS_TYPE_TO);
- }
- __fillAddressInfo(&recipients_addr_info[++recipients_idx], iter->szAddr, MSG_RECIPIENTS_TYPE_TO);
- iter = iter->pNext;
+ /* If group message feature is available, parse to, cc */
+ if (!disabled_group_msg) {
+ int addr_idx = 0;
+ int recipients_idx = 0;
+ if (mmsHeader.pTo) {
+ MsgHeaderAddress *iter = mmsHeader.pTo;
+ while (iter) {
+ MSG_DEBUG("TO : [%s]", iter->szAddr);
+ /* To */
+ if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
+ __fillAddressInfo(&(pMsgInfo->addressList[++addr_idx]), iter->szAddr, MSG_RECIPIENTS_TYPE_TO);
+ }
+ __fillAddressInfo(&recipients_addr_info[++recipients_idx], iter->szAddr, MSG_RECIPIENTS_TYPE_TO);
+
+ iter = iter->pNext;
+ }
}
- }
- if (mmsHeader.pCc) {
- MsgHeaderAddress *iter = mmsHeader.pCc;
- while (iter) {
- MSG_DEBUG("CC : [%s]", iter->szAddr);
- /* Cc */
- if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
- __fillAddressInfo(&(pMsgInfo->addressList[++addr_idx]), iter->szAddr, MSG_RECIPIENTS_TYPE_CC);
+ if (mmsHeader.pCc) {
+ MsgHeaderAddress *iter = mmsHeader.pCc;
+ while (iter) {
+ MSG_DEBUG("CC : [%s]", iter->szAddr);
+ /* Cc */
+ if (normal_msisdn == NULL || normal_msisdn[0] == '\0' || !g_str_has_suffix(iter->szAddr, normal_msisdn)) {
+ __fillAddressInfo(&(pMsgInfo->addressList[++addr_idx]), iter->szAddr, MSG_RECIPIENTS_TYPE_CC);
+ }
+ __fillAddressInfo(&recipients_addr_info[++recipients_idx], iter->szAddr, MSG_RECIPIENTS_TYPE_CC);
+
+ iter = iter->pNext;
}
- __fillAddressInfo(&recipients_addr_info[++recipients_idx], iter->szAddr, MSG_RECIPIENTS_TYPE_CC);
-
- iter = iter->pNext;
}
}
-#endif
}
MSG_SEC_DEBUG("%d, MMS Receive %s End %s->%s %s", pMsgInfo->msgId
MSG_DEBUG("TapiEventGetMsisdnInfo is called.");
bool bRet = false;
+ bool bDisableGroupMessage = false;
if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) {
MSG_ERR("Error. data is NULL. result:0x%x", result);
MSG_DEBUG("Getting MSISDN is failed!");
}
break;
+ } else {
+ bDisableGroupMessage = true;
}
}
+ int tmpVal = 0;
+ if (MsgSettingGetInt(MMS_RECV_GROUP_MESSAGE, &tmpVal) != MSG_SUCCESS)
+ MSG_INFO("MsgSettingGetInt() is failed");
+
+ /* If the value from MMS_RECV_GROUP_MESSAGE is less than 0, it means group message mode is disabled. */
+ if ((tmpVal < 0 && bDisableGroupMessage == false) || (tmpVal > 0 && bDisableGroupMessage == true)) {
+ if (MsgSettingSetInt(MMS_RECV_GROUP_MESSAGE, -tmpVal))
+ MSG_ERR("Error to set config data [%s]", MMS_RECV_GROUP_MESSAGE);
+ }
+
SmsPluginSetting::instance()->setResultFromSim(bRet);
}