From 60e71c3a673eefbe7123695ffb979cd83f1a67ca Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Thu, 15 Sep 2016 16:08:21 +0300 Subject: [PATCH] TizenRefApp-6845 Incoming MMS bubble displayed when DPM enabled Change-Id: I390fdbb5df6966fb6b74dc47481adc721cf01845 Signed-off-by: Denis Dolzhenko --- .../ConvList/Controller/inc/ConvListItem.h | 1 + .../ConvList/Controller/src/ConvListItem.cpp | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Conversation/ConvList/Controller/inc/ConvListItem.h b/src/Conversation/ConvList/Controller/inc/ConvListItem.h index 11c1d12..bf88213 100644 --- a/src/Conversation/ConvList/Controller/inc/ConvListItem.h +++ b/src/Conversation/ConvList/Controller/inc/ConvListItem.h @@ -137,6 +137,7 @@ namespace Msg std::list m_BubbleEntityList; const ThumbId &m_ThumbId; BubbleEntityFactory &m_BubbleEntityFactory; + bool m_IsRestrictedByDpm; }; class IConvListItemListener diff --git a/src/Conversation/ConvList/Controller/src/ConvListItem.cpp b/src/Conversation/ConvList/Controller/src/ConvListItem.cpp index 8b44778..d654e3b 100644 --- a/src/Conversation/ConvList/Controller/src/ConvListItem.cpp +++ b/src/Conversation/ConvList/Controller/src/ConvListItem.cpp @@ -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); -- 2.7.4