Skip to content
Snippets Groups Projects
Commit 85b47e4b authored by Nicolas Werner's avatar Nicolas Werner
Browse files

[konheko] Align send button with bottom and fix events without username

parent ff51895e
No related branches found
No related tags found
No related merge requests found
......@@ -36,11 +36,8 @@ Page {
boundsBehavior: Flickable.StopAtBounds
anchors.left: parent.left
anchors.right: parent.right
verticalLayoutDirection: ListView.BottomToTop
Component.onCompleted: positionViewAtIndex(room.lastRead(), ListView.Contain);
Component.onCompleted: positionViewAtIndex(room.lastRead(), ListView.Contain)
onMovementEnded: {
console.log("movement ended");
if (chatView.atYBeginning) {
......@@ -49,13 +46,12 @@ Page {
}
if (chatView.atYEnd) {
console.log("at end");
room.markRead(0)
room.markRead(0);
} else {
console.log("not at end");
}
}
ScrollDecorator {
flickable: chatView
}
......@@ -81,6 +77,7 @@ Page {
id: sendButton
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingLarge
icon.source: "image://theme/icon-m-send"
onClicked: {
if (messageText.text != "")
......
......@@ -488,10 +488,11 @@ QVariant Room::data(const QModelIndex &index, int role) const {
case UserName:
return QString::fromStdString(std::visit(
[this](const auto &e) -> std::string {
auto user_id = eventUserId(e);
try {
return this->memberInfos.at(eventUserId(e)).display_name;
return this->memberInfos.at(user_id).display_name;
} catch (...) {
return "";
return user_id;
}
},
event));
......@@ -521,7 +522,7 @@ QString Room::userIdToUserName(QString id) {
try {
return QString::fromStdString(this->memberInfos.at(id.toStdString()).display_name);
} catch (...) {
return "";
return id;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment