TizenRefApp-6845 Incoming MMS bubble displayed when DPM enabled 57/88257/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Thu, 15 Sep 2016 13:08:21 +0000 (16:08 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Thu, 15 Sep 2016 13:16:19 +0000 (16:16 +0300)
Change-Id: I390fdbb5df6966fb6b74dc47481adc721cf01845
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Conversation/ConvList/Controller/inc/ConvListItem.h
src/Conversation/ConvList/Controller/src/ConvListItem.cpp

index 11c1d12..bf88213 100644 (file)
@@ -137,6 +137,7 @@ namespace Msg
             std::list<BubbleEntity*> m_BubbleEntityList;
             const ThumbId &m_ThumbId;
             BubbleEntityFactory &m_BubbleEntityFactory;
+            bool m_IsRestrictedByDpm;
     };
 
     class IConvListItemListener
index 8b44778..d654e3b 100644 (file)
@@ -59,6 +59,7 @@ ConvListItem::ConvListItem(const MsgConversationItem &item,
     , m_Time(item.getTime())
     , m_ThumbId(thumbId)
     , m_BubbleEntityFactory(bubbleEntityFactory)
+    , m_IsRestrictedByDpm(item.isRestrictedByDpm())
 {
     prepareBubble(item, searchWord);
 }
@@ -79,6 +80,7 @@ void ConvListItem::updateStatus()
     {
         m_Time = msg->getTime();
         m_NetworkStatus = msg->getNetworkStatus();
+        m_IsRestrictedByDpm = msg->isRestrictedByDpm();
     }
 
     if(m_NetworkStatus == Message::NS_Send_Fail)
@@ -99,7 +101,8 @@ void ConvListItem::updateStatus()
     else if(m_NetworkStatus == Message::NS_Received)
     {
         updateItemType(ConvItemType::Received);
-        updateEntityBgType(BubbleBgViewItem::ReceivedStyle);
+        BubbleBgViewItem::BgType bgType = m_IsRestrictedByDpm ? BubbleBgViewItem::RestrictedStyle : BubbleBgViewItem::ReceivedStyle;
+        updateEntityBgType(bgType);
     }
     else if(m_NetworkStatus == Message::NS_Retrieving)
     {
@@ -184,7 +187,8 @@ BubbleDownloadButtonEntity *ConvListItem::findDownloadButton() const
 void ConvListItem::updateDownloadButton()
 {
     auto *downloadButton = findDownloadButton();
-    downloadButton->disabled(m_NetworkStatus == Message::NS_Retrieving);
+    if(downloadButton)
+        downloadButton->disabled(m_NetworkStatus == Message::NS_Retrieving);
 }
 
 void ConvListItem::addEntity(BubbleEntity *entity)
@@ -207,7 +211,7 @@ void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::str
 {
     BubbleBgViewItem::BgType bgType = getBubbleBgType(item);
     Message::Direction direction = item.getDirection();
-    if(item.isRestrictedByDpm())
+    if(m_IsRestrictedByDpm)
     {
         addEntity(createTextEntity(BubbleBgViewItem::RestrictedStyle, direction, msg("IDS_MSG_BODY_COULDNT_RECEIVE_THIS_MESSAGE_THE_SECURITY_POLICY_PREVENTS_RECEIVING_MESSAGES"), false, ""));
     }
@@ -333,14 +337,17 @@ void ConvListItem::showMainListPopup()
 
     if(m_Type == Message::MT_MMS)
         listPopup.appendItem(msg("IDS_MSG_OPT_VIEW_AS_SLIDESHOW_ABB"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onSlideShowItemPressed), this);
-    if(m_Type == Message::MT_MMS_Noti)
+    if(m_Type == Message::MT_MMS_Noti && m_NetworkStatus != Message::NS_Retrieving)
         listPopup.appendItem(msg("IDS_MSG_BUTTON_DOWNLOAD_ABB3"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onDownloadItemPressed), this);
 
     if(!msgText.empty())
         listPopup.appendItem(msg("IDS_MSG_OPT_COPY_TEXT"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onCopyTextItemPressed), this);
 
-    listPopup.appendItem(msg("IDS_MSGF_OPT_FORWARD"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onForwardItemPressed), this);
-    listPopup.appendItem(msg("IDS_COM_BUTTON_SHARE"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onShareItemPressed), this);
+    if(!m_IsRestrictedByDpm)
+    {
+        listPopup.appendItem(msg("IDS_MSGF_OPT_FORWARD"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onForwardItemPressed), this);
+        listPopup.appendItem(msg("IDS_COM_BUTTON_SHARE"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onShareItemPressed), this);
+    }
 
     if(m_NetworkStatus == Message::NS_Send_Fail)
         listPopup.appendItem(msg("IDS_MSG_OPT_EDIT"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onEditItemPressed), this);