Commit 23a8a904 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/modules/Linphone/Chat/OutgoingMessage): display correctly status message

parent 264a31f6
...@@ -56,7 +56,7 @@ private: ...@@ -56,7 +56,7 @@ private:
if (it == chat.m_entries.end()) if (it == chat.m_entries.end())
return; return;
(*it).first["state"] = state; (*it).first["status"] = state;
int row = distance(chat.m_entries.begin(), it); int row = distance(chat.m_entries.begin(), it);
emit chat.dataChanged(chat.index(row, 0), chat.index(row, 0)); emit chat.dataChanged(chat.index(row, 0), chat.index(row, 0));
...@@ -251,6 +251,7 @@ void ChatModel::fillMessageEntry ( ...@@ -251,6 +251,7 @@ void ChatModel::fillMessageEntry (
dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(static_cast<qint64>(message->getTime()) * 1000); dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(static_cast<qint64>(message->getTime()) * 1000);
dest["content"] = ::Utils::linphoneStringToQString(message->getText()); dest["content"] = ::Utils::linphoneStringToQString(message->getText());
dest["isOutgoing"] = message->isOutgoing(); dest["isOutgoing"] = message->isOutgoing();
dest["status"] = message->getState();
} }
void ChatModel::fillCallStartEntry ( void ChatModel::fillCallStartEntry (
......
...@@ -41,13 +41,13 @@ public: ...@@ -41,13 +41,13 @@ public:
Q_ENUM(CallStatus); Q_ENUM(CallStatus);
enum MessageState { enum MessageStatus {
MessageStateDelivered = linphone::ChatMessageStateDelivered, MessageStatusDelivered = linphone::ChatMessageStateDelivered,
MessageStateInProgress = linphone::ChatMessageStateInProgress, MessageStatusInProgress = linphone::ChatMessageStateInProgress,
MessageStateNotDelivered = linphone::ChatMessageStateNotDelivered MessageStatusNotDelivered = linphone::ChatMessageStateNotDelivered
}; };
Q_ENUM(MessageState); Q_ENUM(MessageStatus);
ChatModel (QObject *parent = Q_NULLPTR); ChatModel (QObject *parent = Q_NULLPTR);
~ChatModel () = default; ~ChatModel () = default;
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
...@@ -27,10 +28,32 @@ Item { ...@@ -27,10 +28,32 @@ Item {
Row { Row {
spacing: ChatStyle.entry.message.extraContent.spacing spacing: ChatStyle.entry.message.extraContent.spacing
Component {
id: icon
Icon { Icon {
height: ChatStyle.entry.lineHeight icon: $chatEntry.status === ChatModel.MessageStatusNotDelivered ? 'chat_error' : 'chat_send'
icon: 'chat_send'
iconSize: ChatStyle.entry.message.outgoing.sendIconSize iconSize: ChatStyle.entry.message.outgoing.sendIconSize
MouseArea {
anchors.fill: parent
onClicked: console.log('resend')
}
}
}
Component {
id: indicator
BusyIndicator {
width: ChatStyle.entry.message.outgoing.sendIconSize
}
}
Loader {
height: ChatStyle.entry.lineHeight
sourceComponent: $chatEntry.status === ChatModel.MessageStatusInProgress
? indicator
: icon
} }
ActionButton { ActionButton {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment