summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksander Kostenko <o.kostenko@samsung.com>2017-05-24 17:47:40 +0300
committerOleksander Kostenko <o.kostenko@samsung.com>2017-05-26 10:17:30 +0300
commitb8db7996af871440e130d27ea2f3ba1ce5836f5e (patch)
tree2197c0d2eb956c3ff3db3e0ea5c9c28cdba4a962
parenteae58f8ea25be502105e5f9e5419c386f5e4d449 (diff)
downloadmessage-b8db7996af871440e130d27ea2f3ba1ce5836f5e.tar.gz
message-b8db7996af871440e130d27ea2f3ba1ce5836f5e.tar.bz2
message-b8db7996af871440e130d27ea2f3ba1ce5836f5e.zip
TizenRefApp-8552 Implement retransmission of message
Change-Id: I98477bd7d2f7ad7b84e4b6d11d69b79524e06595 Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
-rw-r--r--src/Conversation/Controller/inc/ConvList.h1
-rw-r--r--src/Conversation/Controller/inc/ConvListItem.h3
-rw-r--r--src/Conversation/Controller/src/ConvList.cpp16
-rw-r--r--src/Conversation/Controller/src/ConvListItem.cpp16
-rw-r--r--src/Conversation/View/inc/ConvListViewItem.h1
-rw-r--r--src/Conversation/View/src/ConvListViewItem.cpp5
6 files changed, 41 insertions, 1 deletions
diff --git a/src/Conversation/Controller/inc/ConvList.h b/src/Conversation/Controller/inc/ConvList.h
index 9fd840c..5822475 100644
--- a/src/Conversation/Controller/inc/ConvList.h
+++ b/src/Conversation/Controller/inc/ConvList.h
@@ -95,6 +95,7 @@ namespace Msg {
void demoteItem(ConvListItem &item); // move down existing item
void clear();
void markAsRead();
+ void resendMsg(ConvListItem &listItem);
private:
bool m_IsDeleteMode;
diff --git a/src/Conversation/Controller/inc/ConvListItem.h b/src/Conversation/Controller/inc/ConvListItem.h
index e04db94..b0f970d 100644
--- a/src/Conversation/Controller/inc/ConvListItem.h
+++ b/src/Conversation/Controller/inc/ConvListItem.h
@@ -48,6 +48,8 @@ namespace Msg {
void updateStatus();
void updateLangInfo();
void updateTime();
+ void setActionEventFlag(bool isAction = true);
+ bool getActionEventFlag() const;
protected:
Evas_Object *getBubbleContent() override;
@@ -81,6 +83,7 @@ namespace Msg {
WorkingDirRef m_WorkingDir;
BubbleEntityFactory &m_BubbleEntityFactory;
FileViewer m_FileViewer;
+ bool m_ActionEventFlag;
};
}
diff --git a/src/Conversation/Controller/src/ConvList.cpp b/src/Conversation/Controller/src/ConvList.cpp
index abb637a..aa04113 100644
--- a/src/Conversation/Controller/src/ConvList.cpp
+++ b/src/Conversation/Controller/src/ConvList.cpp
@@ -292,11 +292,27 @@ void ConvList::markAsRead()
getMsgStorage().setReadStatus(m_ThreadId);
}
+void ConvList::resendMsg(ConvListItem &listItem)
+{
+ MSG_LOG("");
+ MessageRef msg = getMsgStorage().getMessage(listItem.getMsgId());
+ if (msg)
+ App::getInst().getMsgEngine().getTransport().sendMessage(msg);
+}
+
void ConvList::onListItemSelected(ListItem &listItem)
{
MSG_LOG("");
if (dynamic_cast<ConvReplyListItem*>(&listItem) && m_pListener)
m_pListener->onReplyButtonClicked(*this);
+
+ auto *convItem = dynamic_cast<ConvListItem*>(&listItem);
+ if (convItem) {
+ if (convItem->getStatusType() == ConvListViewItem::FailedStatus && !convItem->getActionEventFlag())
+ resendMsg(*convItem);
+
+ convItem->setActionEventFlag(false);
+ }
}
void ConvList::onListItemLongPressed(ListItem &listItem)
diff --git a/src/Conversation/Controller/src/ConvListItem.cpp b/src/Conversation/Controller/src/ConvListItem.cpp
index c6f28a9..a0e87c2 100644
--- a/src/Conversation/Controller/src/ConvListItem.cpp
+++ b/src/Conversation/Controller/src/ConvListItem.cpp
@@ -46,6 +46,7 @@ ConvListItem::ConvListItem(const MsgConversationItem &item,
, m_Type(item.getType())
, m_WorkingDir(workingDir)
, m_BubbleEntityFactory(bubbleEntityFactory)
+ , m_ActionEventFlag(false)
{
prepareContent(item);
updateViewStatus();
@@ -110,6 +111,16 @@ void ConvListItem::updateLangInfo()
updateTime();
}
+void ConvListItem::setActionEventFlag(bool isAction)
+{
+ m_ActionEventFlag = isAction;
+}
+
+bool ConvListItem::getActionEventFlag() const
+{
+ return m_ActionEventFlag;
+}
+
void ConvListItem::showMobileDataOffPopup()
{
ToastPopup::toast(msgt("WDS_MSG_TPOP_UNABLE_TO_RETRIEVE_MESSAGE_MOBILE_DATA_OFF_ABB"), nullptr);
@@ -184,10 +195,13 @@ void ConvListItem::onAction(BubbleViewItem &item)
MSG_LOG("");
if (auto *audio = dynamic_cast<BubbleAudioEntity*>(&item.getEntity())) {
audio->clickHandler();
+ setActionEventFlag();
} else {
std::string filePath = item.getEntity().getFilePath();
- if (!filePath.empty())
+ if (!filePath.empty()) {
+ setActionEventFlag();
m_FileViewer.launchWithCopy(filePath);
+ }
}
}
diff --git a/src/Conversation/View/inc/ConvListViewItem.h b/src/Conversation/View/inc/ConvListViewItem.h
index f0cda3a..4025af1 100644
--- a/src/Conversation/View/inc/ConvListViewItem.h
+++ b/src/Conversation/View/inc/ConvListViewItem.h
@@ -39,6 +39,7 @@ namespace Msg {
void setCheckedState(bool state, bool updateUi) override;
void setInfoStatus(InfoStatusType statusType);
+ InfoStatusType getStatusType() const;
protected:
virtual Evas_Object *getBubbleContent() = 0;
diff --git a/src/Conversation/View/src/ConvListViewItem.cpp b/src/Conversation/View/src/ConvListViewItem.cpp
index 1e83601..6dc5ad2 100644
--- a/src/Conversation/View/src/ConvListViewItem.cpp
+++ b/src/Conversation/View/src/ConvListViewItem.cpp
@@ -63,6 +63,11 @@ void ConvListViewItem::setInfoStatus(InfoStatusType statusType)
}
}
+ConvListViewItem::InfoStatusType ConvListViewItem::getStatusType() const
+{
+ return m_Status;
+}
+
std::string ConvListViewItem::getText(ListItem &item, const char *part)
{
if (m_Status == NoneStatus || m_Type == Received) {