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:
if (it == chat.m_entries.end())
return;
(*it).first["state"] = state;
(*it).first["status"] = state;
int row = distance(chat.m_entries.begin(), it);
emit chat.dataChanged(chat.index(row, 0), chat.index(row, 0));
......@@ -251,6 +251,7 @@ void ChatModel::fillMessageEntry (
dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(static_cast<qint64>(message->getTime()) * 1000);
dest["content"] = ::Utils::linphoneStringToQString(message->getText());
dest["isOutgoing"] = message->isOutgoing();
dest["status"] = message->getState();
}
void ChatModel::fillCallStartEntry (
......
......@@ -41,13 +41,13 @@ public:
Q_ENUM(CallStatus);
enum MessageState {
MessageStateDelivered = linphone::ChatMessageStateDelivered,
MessageStateInProgress = linphone::ChatMessageStateInProgress,
MessageStateNotDelivered = linphone::ChatMessageStateNotDelivered
enum MessageStatus {
MessageStatusDelivered = linphone::ChatMessageStateDelivered,
MessageStatusInProgress = linphone::ChatMessageStateInProgress,
MessageStatusNotDelivered = linphone::ChatMessageStateNotDelivered
};
Q_ENUM(MessageState);
Q_ENUM(MessageStatus);
ChatModel (QObject *parent = Q_NULLPTR);
~ChatModel () = default;
......
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import Common 1.0
......@@ -27,10 +28,32 @@ Item {
Row {
spacing: ChatStyle.entry.message.extraContent.spacing
Icon {
Component {
id: icon
Icon {
icon: $chatEntry.status === ChatModel.MessageStatusNotDelivered ? 'chat_error' : 'chat_send'
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
icon: 'chat_send'
iconSize: ChatStyle.entry.message.outgoing.sendIconSize
sourceComponent: $chatEntry.status === ChatModel.MessageStatusInProgress
? indicator
: icon
}
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