Show new messages on the bottom

Summary: Like every messaging app I know does

Test Plan: Compare message order with phone

Reviewers: #kde_connect, sredman

Reviewed By: #kde_connect, sredman

Subscribers: sredman, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D14638
This commit is contained in:
Nicolas Fella 2018-08-06 00:19:13 +02:00
parent 21b52d7dcf
commit 5f63f78f77
2 changed files with 10 additions and 5 deletions

View file

@ -44,6 +44,8 @@ public:
DateRole,
};
Q_ENUMS(Roles)
QString threadId() const;
void setThreadId(const QString &threadId);

View file

@ -39,11 +39,14 @@ Kirigami.ScrollablePage
title: person && person.name ? i18n("%1: %2", person.name, phoneNumber) : phoneNumber
ListView {
model: ConversationModel {
model: QSortFilterProxyModel {
id: model
deviceId: device.id()
threadId: page.conversationId
sortOrder: Qt.AscendingOrder
sortRole: ConversationModel.DateRole
sourceModel: ConversationModel {
deviceId: device.id()
threadId: page.conversationId
}
}
spacing: Kirigami.Units.largeSpacing
@ -62,7 +65,7 @@ Kirigami.ScrollablePage
placeholderText: i18n("Say hi...")
onAccepted: {
console.log("sending sms", page.phoneNumber)
model.sendReplyToConversation(message.text)
model.sourceModel.sendReplyToConversation(message.text)
text = ""
}
}