diff --git a/imports/Spectral/Component/Timeline/MessageDelegate.qml b/imports/Spectral/Component/Timeline/MessageDelegate.qml index ca66bdc..0fe10c3 100644 --- a/imports/Spectral/Component/Timeline/MessageDelegate.qml +++ b/imports/Spectral/Component/Timeline/MessageDelegate.qml @@ -68,10 +68,8 @@ ColumnLayout { Control { Layout.maximumWidth: messageListView.width - (!sentByMe ? 32 + messageRow.spacing : 0) - 48 - topPadding: 8 - bottomPadding: 8 - leftPadding: 16 - rightPadding: 16 + verticalPadding: 8 + horizontalPadding: 16 background: Rectangle { color: sentByMe ? "#009DC2" : eventType === "notice" ? "#4285F4" : "#673AB7" diff --git a/imports/Spectral/Panel/RoomDrawer.qml b/imports/Spectral/Panel/RoomDrawer.qml index 9cdc0d0..bb6edd2 100644 --- a/imports/Spectral/Panel/RoomDrawer.qml +++ b/imports/Spectral/Panel/RoomDrawer.qml @@ -48,7 +48,7 @@ Drawer { wrapMode: Label.Wrap horizontalAlignment: Text.AlignHCenter - text: room ? room.memberCount + " Members" : "No Member Count" + text: room ? room.totalMemberCount + " Members" : "No Member Count" } RowLayout { diff --git a/imports/Spectral/Panel/RoomListPanel.qml b/imports/Spectral/Panel/RoomListPanel.qml index a341ec6..2ee2792 100644 --- a/imports/Spectral/Panel/RoomListPanel.qml +++ b/imports/Spectral/Panel/RoomListPanel.qml @@ -813,7 +813,11 @@ Rectangle { inviteDialog.currentRoom = currentRoom inviteDialog.open() } else { - leaveRoom(enteredRoom) + if (enteredRoom) { + enteredRoom.displayed = false + leaveRoom(enteredRoom) + } + currentRoom.displayed = true enterRoom(currentRoom) enteredRoom = currentRoom } diff --git a/include/libqmatrixclient b/include/libqmatrixclient index be7d25e..fcc8d2c 160000 --- a/include/libqmatrixclient +++ b/include/libqmatrixclient @@ -1 +1 @@ -Subproject commit be7d25ed22abd07a254bfb8ff6c30de4fcc79e6a +Subproject commit fcc8d2ca615fce6e42bf1cf6585d60f94a2db926 diff --git a/src/controller.cpp b/src/controller.cpp index 8992e9c..4c87a97 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -42,7 +42,12 @@ Controller::Controller(QObject* parent) QTimer::singleShot(0, this, SLOT(invokeLogin())); } -Controller::~Controller() {} +Controller::~Controller() { + for (Connection* c : m_connections) { + c->stopSync(); + c->saveState(); + } +} inline QString accessTokenFileName(const AccountSettings& account) { QString fileName = account.userId(); @@ -107,6 +112,8 @@ void Controller::addConnection(Connection* c) { m_connections.push_back(c); + c->setLazyLoading(true); + connect(c, &Connection::syncDone, this, [=] { emit syncDone(); c->sync(30000); diff --git a/src/imageprovider.cpp b/src/imageprovider.cpp index c4abc1f..72d8030 100644 --- a/src/imageprovider.cpp +++ b/src/imageprovider.cpp @@ -29,6 +29,7 @@ QImage ImageProvider::requestImage(const QString& id, QSize* pSize, QUrl mxcUri{id}; QImage result = image(mxcUri, requestedSize); + if (result.isNull()) return {}; if (!requestedSize.isEmpty() && result.size() != requestedSize) { QImage scaled = result.scaled(requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); diff --git a/src/spectralroom.cpp b/src/spectralroom.cpp index e003d61..79ef501 100644 --- a/src/spectralroom.cpp +++ b/src/spectralroom.cpp @@ -195,8 +195,6 @@ QDateTime SpectralRoom::lastActiveTime() { return messageEvents().rbegin()->get()->timestamp(); } -float SpectralRoom::orderForTag(QString name) { return tag(name).order; } - int SpectralRoom::savedTopVisibleIndex() const { return firstDisplayedMarker() == timelineEdge() ? 0 diff --git a/src/spectralroom.h b/src/spectralroom.h index 21474ca..309a565 100644 --- a/src/spectralroom.h +++ b/src/spectralroom.h @@ -66,7 +66,6 @@ class SpectralRoom : public Room { } } - Q_INVOKABLE float orderForTag(QString name); Q_INVOKABLE int savedTopVisibleIndex() const; Q_INVOKABLE int savedBottomVisibleIndex() const; Q_INVOKABLE void saveViewport(int topIndex, int bottomIndex); diff --git a/src/userlistmodel.cpp b/src/userlistmodel.cpp index 4fc65e8..851cd09 100644 --- a/src/userlistmodel.cpp +++ b/src/userlistmodel.cpp @@ -34,12 +34,8 @@ void UserListModel::setRoom(QMatrixClient::Room* room) { connect(m_currentRoom, &Room::memberRenamed, this, &UserListModel::userAdded); { - QElapsedTimer et; - et.start(); m_users = m_currentRoom->users(); std::sort(m_users.begin(), m_users.end(), room->memberSorter()); - qDebug() << "Sorting" << m_users.size() << "user(s) in" - << m_currentRoom->displayName() << "took" << et; } for (User* user : m_users) { connect(user, &User::avatarChanged, this, &UserListModel::avatarChanged);