mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
fix(ui/modules/Linphone/Chat/OutgoingMessage): display correctly status message
This commit is contained in:
parent
264a31f646
commit
23a8a9048b
3 changed files with 33 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue