diff --git a/imports/Spectral/Panel/RoomListPanel.qml b/imports/Spectral/Panel/RoomListPanel.qml index 254078a21..ad21d40c6 100644 --- a/imports/Spectral/Panel/RoomListPanel.qml +++ b/imports/Spectral/Panel/RoomListPanel.qml @@ -331,12 +331,12 @@ Item { acceptInvitationDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom}).open() } else { if (enteredRoom) { - enteredRoom.displayed = false leaveRoom(enteredRoom) + enteredRoom.displayed = false } - currentRoom.displayed = true enterRoom(currentRoom) enteredRoom = currentRoom + currentRoom.displayed = true } } onSecondaryClicked: roomListContextMenu.createObject(ApplicationWindow.overlay, {"room": currentRoom}).popup() diff --git a/imports/Spectral/Panel/RoomPanel.qml b/imports/Spectral/Panel/RoomPanel.qml index df05a5f48..e435ec807 100644 --- a/imports/Spectral/Panel/RoomPanel.qml +++ b/imports/Spectral/Panel/RoomPanel.qml @@ -70,6 +70,7 @@ Item { Layout.alignment: Qt.AlignHCenter text: "Choose local file" + color: MPalette.foreground } } diff --git a/src/main.cpp b/src/main.cpp index b6ee77f16..f54d83ff7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,18 +26,6 @@ using namespace QMatrixClient; int main(int argc, char* argv[]) { -#if defined(Q_OS_LINUX) || defined(Q_OS_WIN) || defined(Q_OS_FREEBSD) - if (qgetenv("QT_SCALE_FACTOR").size() == 0) { - QSettings settings("ENCOM", "Spectral"); - float factor = settings.value("Interface/dpi", 100).toFloat() / 100; - - qDebug() << "DPI:" << factor; - - if (factor != -1) - qputenv("QT_SCALE_FACTOR", QString::number(factor).toUtf8()); - } -#endif - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); QNetworkProxyFactory::setUseSystemConfiguration(true); diff --git a/src/spectralroom.cpp b/src/spectralroom.cpp index ddbdb95b7..bcd37d9dc 100644 --- a/src/spectralroom.cpp +++ b/src/spectralroom.cpp @@ -107,12 +107,26 @@ void SpectralRoom::sendTypingNotification(bool isTyping) { } QString SpectralRoom::lastEvent() { - if (timelineSize() == 0) - return ""; - const RoomEvent* lastEvent = messageEvents().rbegin()->get(); - return user(lastEvent->senderId())->displayname() + - (lastEvent->isStateEvent() ? " " : ": ") + - utils::removeReply(eventToString(*lastEvent)); + for (auto i = messageEvents().rbegin(); i < messageEvents().rend(); i++) { + const RoomEvent* evt = i->get(); + + if (is(*evt)) + continue; + if (evt->isRedacted()) + continue; + + if (evt->isStateEvent() && + static_cast(evt)->repeatsState()) + continue; + + if (connection()->isIgnored(user(evt->senderId()))) + continue; + + return user(evt->senderId())->displayname() + + (evt->isStateEvent() ? " " : ": ") + + utils::removeReply(eventToString(*evt)); + } + return ""; } bool SpectralRoom::isEventHighlighted(const RoomEvent* e) const {