TizenRefApp-5808 Text of Reject Call Message isn't Displayed in Conversation 29/64329/4
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Thu, 31 Mar 2016 12:00:25 +0000 (15:00 +0300)
committerAndrey Klimenko <and.klimenko@samsung.com>
Tue, 5 Apr 2016 08:34:01 +0000 (01:34 -0700)
Change-Id: I3fd1c2cf8b9fb3a602f625f212aec1fdbec6cb1f
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Common/MsgEngine/src/private/MessagePrivate.cpp
src/Common/MsgEngine/src/private/MsgStoragePrivate.cpp
src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp
src/Common/MsgEngine/src/private/MsgUtilsPrivate.h

index 1be1193..b95deeb 100644 (file)
@@ -175,13 +175,7 @@ void MessagePrivate::commit()
 
 bool MessagePrivate::isMms() const
 {
-    int type = MSG_TYPE_SMS;
-    msg_get_int_value(m_MsgStruct, MSG_MESSAGE_TYPE_INT, &type);
-
-    if(type == MSG_TYPE_MMS)
-        return true;
-    else if(type != MSG_TYPE_SMS)
-        MSG_LOG("invalid msg type!", type);
-
-    return false;
+    int nativeType = MSG_TYPE_INVALID;
+    msg_get_int_value(m_MsgStruct, MSG_MESSAGE_TYPE_INT, &nativeType);
+    return MsgUtilsPrivate::nativeToMessageType(nativeType) == Message::MT_MMS;
 }
index 8ee38a5..7f6fbf4 100644 (file)
@@ -277,16 +277,17 @@ MessageRef MsgStoragePrivate::getMessage(MsgId id)
 
     if(msg_get_message(m_ServiceHandle, id, msg, sendOpt) == 0)
     {
-        int msgType = MSG_TYPE_INVALID;
-        msg_get_int_value(msg, MSG_MESSAGE_TYPE_INT, &msgType);
+        int nativeType = MSG_TYPE_INVALID;
+        msg_get_int_value(msg, MSG_MESSAGE_TYPE_INT, &nativeType);
+        Message::Type type = MsgUtilsPrivate::nativeToMessageType(nativeType);
 
-        switch(msgType)
+        switch(type)
         {
-            case MSG_TYPE_SMS:
+            case Message::MT_SMS:
                 msgRef = std::make_shared<MessageSMSPrivate>(true, msg);
                 break;
 
-            case MSG_TYPE_MMS:
+            case Message::MT_MMS:
                 msgRef = std::make_shared<MessageMmsPrivate>(true, msg);
                 break;
 
index f65162b..ee84348 100644 (file)
@@ -186,29 +186,31 @@ MsgAddress::RecipientType MsgUtilsPrivate::nativeToRecipientType(int type)
     }
 }
 
-int MsgUtilsPrivate::messageTypeToNative(Message::Type type)
-{
-    switch(type)
-    {
-        case Message::MT_SMS:
-            return MSG_TYPE_SMS;
-
-        case Message::MT_MMS:
-            return MSG_TYPE_MMS;
-
-        default:
-            return MSG_TYPE_INVALID;
-    }
-}
-
 Message::Type MsgUtilsPrivate::nativeToMessageType(int type)
 {
     switch(type)
     {
         case MSG_TYPE_SMS:
+        case MSG_TYPE_SMS_CB:
+        case MSG_TYPE_SMS_JAVACB:
+        case MSG_TYPE_SMS_WAPPUSH:
+        case MSG_TYPE_SMS_MWI:
+        case MSG_TYPE_SMS_SYNCML:
+        case MSG_TYPE_SMS_REJECT:
+        case MSG_TYPE_SMS_ETWS_PRIMARY:
+        case MSG_TYPE_SMS_ETWS_SECONDARY:
+        case MSG_TYPE_SMS_CMAS_PRESIDENTIAL:
+        case MSG_TYPE_SMS_CMAS_EXTREME:
+        case MSG_TYPE_SMS_CMAS_SEVERE:
+        case MSG_TYPE_SMS_CMAS_AMBER:
+        case MSG_TYPE_SMS_CMAS_TEST:
+        case MSG_TYPE_SMS_CMAS_EXERCISE:
+        case MSG_TYPE_SMS_CMAS_OPERATOR_DEFINED:
             return Message::MT_SMS;
 
         case MSG_TYPE_MMS:
+        case MSG_TYPE_MMS_JAVA:
+        case MSG_TYPE_MMS_NOTI:
             return Message::MT_MMS;
 
         default:
index ab81206..9fd1322 100644 (file)
@@ -35,7 +35,6 @@ namespace Msg
             static int directionToNative(Message::Direction direction);
             static int addressTypeToNative(MsgAddress::AddressType type);
             static int recipientTypeToNative(MsgAddress::RecipientType type);
-            static int messageTypeToNative(Message::Type type);
             static Message::Direction nativeToDirection(int direction);
             static Message::MessageStorageType nativeToMessageStorage(int id);
             static MsgAddress::AddressType nativeToAddressType(int type);