#define BUBBLE_BG_FAILED_COLOR_PRESSED 0 0 0 133
#define BUBBLE_BG_RECEIVED_COLOR 65 197 217 255
#define BUBBLE_BG_RECEIVED_COLOR_PRESSED 50 150 166 255
+ #define BUBBLE_BG_RESTRICTED_COLOR 184 41 62 255
+ #define BUBBLE_BG_RESTRICTED_COLOR_PRESSED 146 33 49 255
images {
image: "messages_bubble_bg.#.png" RAW;
}
}
}
+
+ group {
+ name: "conv/list/bubble_restricted_bg";
+ inherit: "conv/list/bubble_draft_bg";
+ parts {
+ part {
+ name: "bg";
+ description {
+ state: "default";
+ color: BUBBLE_BG_RESTRICTED_COLOR;
+ }
+ description {
+ state: "pressed";
+ inherit: "default";
+ color: BUBBLE_BG_RESTRICTED_COLOR_PRESSED;
+ }
+ }
+ }
+ }
}
* @return true in case of mms, false otherwise.
*/
virtual bool isMms() const = 0;
+
+ /**
+ * @brief Checks whether this message is restricted by DPM policy.
+ * @return true in case of restriction, false otherwise.
+ */
+ virtual bool isRestrictedByDpm() const = 0;
};
}
* @return media-files list.
*/
virtual const MsgConvMediaList &getMediaList() const = 0;
+
+ /**
+ * @brief Checks whether this message is restricted by DPM policy.
+ * @return true in case of restriction, false otherwise.
+ */
+ virtual bool isRestrictedByDpm() const = 0;
};
}
Message::Type messageType = MsgUtilsPrivate::nativeToMessageType(nativeType);
return MsgUtils::isMms(messageType);
}
+
+bool MessagePrivate::isRestrictedByDpm() const
+{
+ bool restricted = false;
+ msg_get_bool_value(m_MsgStruct, MSG_MESSAGE_DPM_RESTRICTED_BOOL, &restricted);
+ return restricted;
+}
virtual void setMessageStorageType(Message::MessageStorageType msgStorage);
virtual Message::MessageStorageType getMessageStorageType() const;
virtual bool isMms() const;
+ virtual bool isRestrictedByDpm() const;
void setId(MsgId id);
void set(msg_struct_t msgStruct);
m_MultipartList.set(multipartList);
return m_MultipartList;
}
+
+bool MsgConversationItemPrivate::isRestrictedByDpm() const
+{
+ bool restricted = false;
+ msg_get_bool_value(m_MsgStruct, MSG_CONV_MSG_DPM_RESTRICTED_BOOL, &restricted);
+ return restricted;
+}
virtual int getPagesCount() const;
virtual int getAttachCount() const;
virtual const MsgConvMediaListHandlePrivate &getMediaList() const;
+ virtual bool isRestrictedByDpm() const;
protected:
mutable MsgConvMediaListHandlePrivate m_MultipartList;
{
BubbleBgViewItem::BgType bgType = getBubbleBgType(item);
Message::Direction direction = item.getDirection();
- if(!MsgUtils::isMms(m_Type))
+ if(item.isRestrictedByDpm())
+ {
+ //TODO: Obtain IDS for this string
+ addEntity(createTextEntity(BubbleBgViewItem::RestrictedStyle, direction, "Message not received. The security policy restricts receiving messages.", true, ""));
+ }
+ else if(!MsgUtils::isMms(m_Type))
{
addEntity(createTextEntity(bgType, direction, item.getText(), true, searchWord));
}
SentStyle,
ReceivedStyle,
DraftStyle,
- FailedStyle
+ FailedStyle,
+ RestrictedStyle
};
public:
using namespace Msg;
const std::string whiteTextColor = "#fafafa";
const std::string darkTextColor = "#808080";
+const std::string redTextColor = "#b8293e";
#define WHITE_OBJ_COLOR 250, 250, 250, 255
#define DARK_OBJ_COLOR 128, 128, 128, 255
case FailedStyle:
group = "conv/list/bubble_failed_bg";
break;
+ case RestrictedStyle:
+ group = "conv/list/bubble_restricted_bg";
+ break;
}
setEo(addLayout(parent, CONV_LIST_BUBBLE_EDJ_PATH, group));
std::string BubbleBgViewItem::applyColor(const std::string &text, BgType bgType)
{
- const std::string &color = (bgType == SentStyle || bgType == ReceivedStyle) ? whiteTextColor : darkTextColor;
+ const std::string &color = (bgType == RestrictedStyle) ? redTextColor : (bgType == SentStyle || bgType == ReceivedStyle) ? whiteTextColor : darkTextColor;
return TextDecorator::make(text, color);
}