From 96f4169be97715e6b6b45663492e3791ba21ae09 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 8 Jun 2020 01:45:24 +0200 Subject: [PATCH 01/12] Show presence and set custom status messages --- resources/qml/Avatar.qml | 18 +++++++ resources/qml/TimelineView.qml | 14 +++++- src/Cache.cpp | 72 ++++++++++++++++++++++++++++ src/Cache.h | 6 +++ src/Cache_p.h | 13 +++++ src/ChatPage.cpp | 20 ++++++++ src/ChatPage.h | 6 +++ src/UserInfoWidget.cpp | 24 ++++++++++ src/UserInfoWidget.h | 4 ++ src/timeline/TimelineViewManager.cpp | 12 +++++ src/timeline/TimelineViewManager.h | 3 ++ 11 files changed, 191 insertions(+), 1 deletion(-) diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml index 465a8e1c..9ac7b562 100644 --- a/resources/qml/Avatar.qml +++ b/resources/qml/Avatar.qml @@ -9,6 +9,7 @@ Rectangle { radius: settings.avatarCircles ? height/2 : 3 property alias url: img.source + property string userid property string displayName Label { @@ -42,6 +43,23 @@ Rectangle { radius: settings.avatarCircles ? height/2 : 3 } } + } + + Rectangle { + anchors.bottom: avatar.bottom + anchors.right: avatar.right + + height: avatar.height / 6 + width: height + radius: settings.avatarCircles ? height / 2 : height / 4 + color: switch (timelineManager.userPresence(userid)) { + case "online": return "#00cc66" + case "unavailable": return "#ff9933" + case "offline": return "#a82353" + default: "transparent" + } + } + color: colors.base } diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 08130033..ea6bf093 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -152,6 +152,8 @@ Page { onCountChanged: if (atYEnd) model.currentIndex = 0 // Mark last event as read, since we are at the bottom + property int delegateMaxWidth: (settings.timelineMaxWidth > 100 && (parent.width - settings.timelineMaxWidth) > 32) ? settings.timelineMaxWidth : (parent.width - 32) + delegate: Rectangle { // This would normally be previousSection, but our model's order is inverted. property bool sectionBoundary: (ListView.nextSection != "" && ListView.nextSection !== ListView.section) || model.index === chat.count - 1 @@ -159,7 +161,7 @@ Page { id: wrapper property Item section anchors.horizontalCenter: parent.horizontalCenter - width: (settings.timelineMaxWidth > 100 && (parent.width - settings.timelineMaxWidth) > 32) ? settings.timelineMaxWidth : (parent.width - 32) + width: chat.delegateMaxWidth height: section ? section.height + timelinerow.height : timelinerow.height color: "transparent" @@ -236,6 +238,7 @@ Page { height: avatarSize url: chat.model.avatarUrl(modelData.userId).replace("mxc://", "image://MxcImage/") displayName: modelData.userName + userid: modelData.userId MouseArea { anchors.fill: parent @@ -258,6 +261,15 @@ Page { propagateComposedEvents: true } } + + Label { + color: colors.buttonText + text: timelineManager.userStatus(modelData.userId) + textFormat: Text.PlainText + elide: Text.ElideRight + width: chat.delegateMaxWidth - parent.spacing*2 - userName.implicitWidth - avatarSize + font.italic: true + } } } } diff --git a/src/Cache.cpp b/src/Cache.cpp index 009cbabc..d9d1134e 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -952,6 +952,8 @@ Cache::saveState(const mtx::responses::Sync &res) saveInvites(txn, res.rooms.invite); + savePresence(txn, res.presence); + removeLeftRooms(txn, res.rooms.leave); txn.commit(); @@ -1037,6 +1039,21 @@ Cache::saveInvite(lmdb::txn &txn, } } +void +Cache::savePresence( + lmdb::txn &txn, + const std::vector> &presenceUpdates) +{ + for (const auto &update : presenceUpdates) { + auto presenceDb = getPresenceDb(txn); + + lmdb::dbi_put(txn, + presenceDb, + lmdb::val(update.sender), + lmdb::val(json(update.content).dump())); + } +} + std::vector Cache::roomsWithStateUpdates(const mtx::responses::Sync &res) { @@ -2254,6 +2271,50 @@ Cache::removeAvatarUrl(const QString &room_id, const QString &user_id) AvatarUrls.remove(fmt); } +mtx::presence::PresenceState +Cache::presenceState(const std::string &user_id) +{ + lmdb::val presenceVal; + + auto txn = lmdb::txn::begin(env_); + auto db = getPresenceDb(txn); + auto res = lmdb::dbi_get(txn, db, lmdb::val(user_id), presenceVal); + + mtx::presence::PresenceState state = mtx::presence::offline; + + if (res) { + mtx::events::presence::Presence presence = + json::parse(std::string(presenceVal.data(), presenceVal.size())); + state = presence.presence; + } + + txn.commit(); + + return state; +} + +std::string +Cache::statusMessage(const std::string &user_id) +{ + lmdb::val presenceVal; + + auto txn = lmdb::txn::begin(env_); + auto db = getPresenceDb(txn); + auto res = lmdb::dbi_get(txn, db, lmdb::val(user_id), presenceVal); + + std::string status_msg; + + if (res) { + mtx::events::presence::Presence presence = + json::parse(std::string(presenceVal.data(), presenceVal.size())); + status_msg = presence.status_msg; + } + + txn.commit(); + + return status_msg; +} + void to_json(json &j, const RoomInfo &info) { @@ -2425,6 +2486,17 @@ insertAvatarUrl(const QString &room_id, const QString &user_id, const QString &a instance_->insertAvatarUrl(room_id, user_id, avatar_url); } +mtx::presence::PresenceState +presenceState(const std::string &user_id) +{ + return instance_->presenceState(user_id); +} +std::string +statusMessage(const std::string &user_id) +{ + return instance_->statusMessage(user_id); +} + //! Load saved data for the display names & avatars. void populateMembers() diff --git a/src/Cache.h b/src/Cache.h index 12465c9d..b5275623 100644 --- a/src/Cache.h +++ b/src/Cache.h @@ -54,6 +54,12 @@ insertDisplayName(const QString &room_id, const QString &user_id, const QString void insertAvatarUrl(const QString &room_id, const QString &user_id, const QString &avatar_url); +// presence +mtx::presence::PresenceState +presenceState(const std::string &user_id); +std::string +statusMessage(const std::string &user_id); + //! Load saved data for the display names & avatars. void populateMembers(); diff --git a/src/Cache_p.h b/src/Cache_p.h index 0d66a608..892b66a5 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h @@ -52,6 +52,10 @@ public: static QString displayName(const QString &room_id, const QString &user_id); static QString avatarUrl(const QString &room_id, const QString &user_id); + // presence + mtx::presence::PresenceState presenceState(const std::string &user_id); + std::string statusMessage(const std::string &user_id); + static void removeDisplayName(const QString &room_id, const QString &user_id); static void removeAvatarUrl(const QString &room_id, const QString &user_id); @@ -377,6 +381,10 @@ private: void saveInvites(lmdb::txn &txn, const std::map &rooms); + void savePresence( + lmdb::txn &txn, + const std::vector> &presenceUpdates); + //! Sends signals for the rooms that are removed. void removeLeftRooms(lmdb::txn &txn, const std::map &rooms) @@ -430,6 +438,11 @@ private: return lmdb::dbi::open(txn, std::string(room_id + "/mentions").c_str(), MDB_CREATE); } + lmdb::dbi getPresenceDb(lmdb::txn &txn) + { + return lmdb::dbi::open(txn, "presence", MDB_CREATE); + } + //! Retrieves or creates the database that stores the open OLM sessions between our device //! and the given curve25519 key which represents another device. //! diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index c7f5164a..f2b8253b 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -61,6 +61,7 @@ constexpr size_t MAX_ONETIME_KEYS = 50; Q_DECLARE_METATYPE(std::optional) Q_DECLARE_METATYPE(std::optional) +Q_DECLARE_METATYPE(mtx::presence::PresenceState) ChatPage::ChatPage(QSharedPointer userSettings, QWidget *parent) : QWidget(parent) @@ -72,6 +73,7 @@ ChatPage::ChatPage(QSharedPointer userSettings, QWidget *parent) qRegisterMetaType>(); qRegisterMetaType>(); + qRegisterMetaType(); topLayout_ = new QHBoxLayout(this); topLayout_->setSpacing(0); @@ -1221,6 +1223,24 @@ ChatPage::sendTypingNotifications() }); } +QString +ChatPage::status() const +{ + return QString::fromStdString(cache::statusMessage(utils::localUser().toStdString())); +} + +void +ChatPage::setStatus(const QString &status) +{ + http::client()->put_presence_status( + currentPresence(), status.toStdString(), [](mtx::http::RequestErr err) { + if (err) { + nhlog::net()->warn("failed to set presence status_msg: {}", + err->matrix_error.error); + } + }); +} + void ChatPage::initialSyncHandler(const mtx::responses::Sync &res, mtx::http::RequestErr err) { diff --git a/src/ChatPage.h b/src/ChatPage.h index 83b4e76d..72fc3b81 100644 --- a/src/ChatPage.h +++ b/src/ChatPage.h @@ -89,6 +89,11 @@ public: void initiateLogout(); void focusMessageInput(); + QString status() const; + void setStatus(const QString &status); + + mtx::presence::PresenceState currentPresence() const { return mtx::presence::online; } + public slots: void leaveRoom(const QString &room_id); void createRoom(const mtx::requests::CreateRoom &req); @@ -154,6 +159,7 @@ signals: const QImage &icon); void updateGroupsInfo(const mtx::responses::JoinedGroups &groups); + void retrievedPresence(const QString &statusMsg, mtx::presence::PresenceState state); void themeChanged(); void decryptSidebarChanged(); diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp index e11aa6aa..38677f25 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp @@ -16,7 +16,9 @@ * along with this program. If not, see . */ +#include #include +#include #include #include #include @@ -24,6 +26,7 @@ #include +#include "ChatPage.h" #include "Config.h" #include "MainWindow.h" #include "Splitter.h" @@ -105,6 +108,27 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) connect(logoutButton_, &QPushButton::clicked, this, []() { MainWindow::instance()->openLogoutDialog(); }); + + menu = new QMenu(this); + + auto setStatusAction = menu->addAction(tr("Set custom status message")); + connect(setStatusAction, &QAction::triggered, this, [this]() { + bool ok = false; + QString text = QInputDialog::getText(this, + tr("Custom status message"), + tr("Status:"), + QLineEdit::Normal, + ChatPage::instance()->status(), + &ok); + if (ok && !text.isEmpty()) + ChatPage::instance()->setStatus(text); + }); +} + +void +UserInfoWidget::contextMenuEvent(QContextMenuEvent *event) +{ + menu->popup(event->globalPos()); } void diff --git a/src/UserInfoWidget.h b/src/UserInfoWidget.h index 575ade52..03ab2cf0 100644 --- a/src/UserInfoWidget.h +++ b/src/UserInfoWidget.h @@ -26,6 +26,7 @@ class OverlayModal; class QLabel; class QHBoxLayout; class QVBoxLayout; +class QMenu; class UserInfoWidget : public QWidget { @@ -48,6 +49,7 @@ public: protected: void resizeEvent(QResizeEvent *event) override; void paintEvent(QPaintEvent *event) override; + void contextMenuEvent(QContextMenuEvent *) override; private: Avatar *userAvatar_; @@ -70,4 +72,6 @@ private: int logoutButtonSize_; QColor borderColor_; + + QMenu *menu = nullptr; }; diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 30abe506..ff457af9 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -57,6 +57,18 @@ TimelineViewManager::userColor(QString id, QColor background) return userColors.value(id); } +QString +TimelineViewManager::userPresence(QString id) const +{ + return QString::fromStdString( + mtx::presence::to_string(cache::presenceState(id.toStdString()))); +} +QString +TimelineViewManager::userStatus(QString id) const +{ + return QString::fromStdString(cache::statusMessage(id.toStdString())); +} + TimelineViewManager::TimelineViewManager(QSharedPointer userSettings, QWidget *parent) : imgProvider(new MxcImageProvider()) , colorImgProvider(new ColorImageProvider()) diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index 45a603af..e677ef20 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -41,6 +41,9 @@ public: Q_INVOKABLE void openImageOverlay(QString mxcUrl, QString eventId) const; Q_INVOKABLE QColor userColor(QString id, QColor background); + Q_INVOKABLE QString userPresence(QString id) const; + Q_INVOKABLE QString userStatus(QString id) const; + signals: void clearRoomMessageCount(QString roomid); void updateRoomsLastMessage(QString roomid, const DescInfo &info); From f2bfa61e086266a1c1e39e39dd8228c9451b2707 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 8 Jun 2020 20:26:37 +0200 Subject: [PATCH 02/12] Add menu actions to set presence --- src/ChatPage.cpp | 18 ++++++++++++++++++ src/ChatPage.h | 2 +- src/UserInfoWidget.cpp | 23 +++++++++++++++++++++++ src/UserSettingsPage.cpp | 21 ++++++++++++++++++++- src/UserSettingsPage.h | 14 ++++++++++++++ 5 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index f2b8253b..673fc9a2 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -986,6 +986,8 @@ ChatPage::startInitialSync() mtx::http::SyncOpts opts; opts.timeout = 0; + opts.set_presence = currentPresence(); + http::client()->sync( opts, std::bind( @@ -996,6 +998,7 @@ void ChatPage::trySync() { mtx::http::SyncOpts opts; + opts.set_presence = currentPresence(); if (!connectivityTimer_.isActive()) connectivityTimer_.start(); @@ -1241,6 +1244,21 @@ ChatPage::setStatus(const QString &status) }); } +mtx::presence::PresenceState +ChatPage::currentPresence() const +{ + switch (userSettings_->presence()) { + case UserSettings::Presence::Online: + return mtx::presence::online; + case UserSettings::Presence::Unavailable: + return mtx::presence::unavailable; + case UserSettings::Presence::Offline: + return mtx::presence::offline; + default: + return mtx::presence::online; + } +} + void ChatPage::initialSyncHandler(const mtx::responses::Sync &res, mtx::http::RequestErr err) { diff --git a/src/ChatPage.h b/src/ChatPage.h index 72fc3b81..e1a342d1 100644 --- a/src/ChatPage.h +++ b/src/ChatPage.h @@ -92,7 +92,7 @@ public: QString status() const; void setStatus(const QString &status); - mtx::presence::PresenceState currentPresence() const { return mtx::presence::online; } + mtx::presence::PresenceState currentPresence() const; public slots: void leaveRoom(const QString &room_id); diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp index 38677f25..bf59427c 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp @@ -31,6 +31,7 @@ #include "MainWindow.h" #include "Splitter.h" #include "UserInfoWidget.h" +#include "UserSettingsPage.h" #include "ui/Avatar.h" #include "ui/FlatButton.h" #include "ui/OverlayModal.h" @@ -123,6 +124,28 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) if (ok && !text.isEmpty()) ChatPage::instance()->setStatus(text); }); + auto setAutoPresence = menu->addAction(tr("Set presence automatically")); + connect(setAutoPresence, &QAction::triggered, this, [this]() { + ChatPage::instance()->userSettings()->setPresence( + UserSettings::Presence::AutomaticPresence); + ChatPage::instance()->setStatus(ChatPage::instance()->status()); + }); + auto setOnline = menu->addAction(tr("Online")); + connect(setOnline, &QAction::triggered, this, [this]() { + ChatPage::instance()->userSettings()->setPresence(UserSettings::Presence::Online); + ChatPage::instance()->setStatus(ChatPage::instance()->status()); + }); + auto setUnavailable = menu->addAction(tr("Unavailable")); + connect(setUnavailable, &QAction::triggered, this, [this]() { + ChatPage::instance()->userSettings()->setPresence( + UserSettings::Presence::Unavailable); + ChatPage::instance()->setStatus(ChatPage::instance()->status()); + }); + auto setOffline = menu->addAction(tr("Offline")); + connect(setOffline, &QAction::triggered, this, [this]() { + ChatPage::instance()->userSettings()->setPresence(UserSettings::Presence::Offline); + ChatPage::instance()->setStatus(ChatPage::instance()->status()); + }); } void diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index dfd99069..659e8ceb 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "Cache.h" #include "Config.h" @@ -46,7 +47,11 @@ #include "config/nheko.h" -UserSettings::UserSettings() { load(); } +UserSettings::UserSettings() +{ + qRegisterMetaType(); + load(); +} void UserSettings::load() @@ -72,6 +77,9 @@ UserSettings::load() decryptSidebar_ = settings.value("user/decrypt_sidebar", true).toBool(); emojiFont_ = settings.value("user/emoji_font_family", "default").toString(); baseFontSize_ = settings.value("user/font_size", QFont().pointSizeF()).toDouble(); + presence_ = + settings.value("user/presence", QVariant::fromValue(Presence::AutomaticPresence)) + .value(); applyTheme(); } @@ -243,6 +251,16 @@ UserSettings::setEmojiFontFamily(QString family) save(); } +void +UserSettings::setPresence(Presence state) +{ + if (state == presence_) + return; + presence_ = state; + emit presenceChanged(state); + save(); +} + void UserSettings::setTheme(QString theme) { @@ -337,6 +355,7 @@ UserSettings::save() settings.setValue("theme", theme()); settings.setValue("font_family", font_); settings.setValue("emoji_font_family", emojiFont_); + settings.setValue("presence", QVariant::fromValue(presence_)); settings.endGroup(); diff --git a/src/UserSettingsPage.h b/src/UserSettingsPage.h index fb807067..550f207e 100644 --- a/src/UserSettingsPage.h +++ b/src/UserSettingsPage.h @@ -68,10 +68,20 @@ class UserSettings : public QObject Q_PROPERTY(QString font READ font WRITE setFontFamily NOTIFY fontChanged) Q_PROPERTY( QString emojiFont READ emojiFont WRITE setEmojiFontFamily NOTIFY emojiFontChanged) + Q_PROPERTY(Presence presence READ presence WRITE setPresence NOTIFY presenceChanged) public: UserSettings(); + enum class Presence + { + AutomaticPresence, + Online, + Unavailable, + Offline, + }; + Q_ENUM(Presence); + void save(); void load(); void applyTheme(); @@ -93,6 +103,7 @@ public: void setDesktopNotifications(bool state); void setAvatarCircles(bool state); void setDecryptSidebar(bool state); + void setPresence(Presence state); QString theme() const { return !theme_.isEmpty() ? theme_ : defaultTheme_; } bool messageHoverHighlight() const { return messageHoverHighlight_; } @@ -112,6 +123,7 @@ public: double fontSize() const { return baseFontSize_; } QString font() const { return font_; } QString emojiFont() const { return emojiFont_; } + Presence presence() const { return presence_; } signals: void groupViewStateChanged(bool state); @@ -132,6 +144,7 @@ signals: void fontSizeChanged(double state); void fontChanged(QString state); void emojiFontChanged(QString state); + void presenceChanged(Presence state); private: // Default to system theme if QT_QPA_PLATFORMTHEME var is set. @@ -157,6 +170,7 @@ private: double baseFontSize_; QString font_; QString emojiFont_; + Presence presence_; }; class HorizontalLine : public QFrame From bf440f9a3168525ee9cf9f41a2739b7169568322 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 8 Jun 2020 21:57:09 +0200 Subject: [PATCH 03/12] Bump mtxclient --- CMakeLists.txt | 2 +- io.github.NhekoReborn.Nheko.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4da2373c..1c382abf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,7 +334,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG 795b6a82d4f10c629ce0eb99803cc677c413f940 + GIT_TAG a897142a3fa6ece92daa1040551fb8ac09be1766 ) FetchContent_MakeAvailable(MatrixClient) else() diff --git a/io.github.NhekoReborn.Nheko.json b/io.github.NhekoReborn.Nheko.json index 7ffb1995..feeb1960 100644 --- a/io.github.NhekoReborn.Nheko.json +++ b/io.github.NhekoReborn.Nheko.json @@ -146,9 +146,9 @@ "name": "mtxclient", "sources": [ { - "sha256": "7ba85bb477c9e17e2389faf2333034aa9ceae4b1c65d6bf5f7067f2799e9b770", + "sha256": "6a4368da5fda1db426c36c9a7b26c6e62ca99bd8c7fea421460156642e65a5cb", "type": "archive", - "url": "https://github.com/Nheko-Reborn/mtxclient/archive/795b6a82d4f10c629ce0eb99803cc677c413f940.tar.gz" + "url": "https://github.com/Nheko-Reborn/mtxclient/archive/a897142a3fa6ece92daa1040551fb8ac09be1766.tar.gz" } ] }, From 814868024c9898e9a42f03c5cede9d78f526d3a2 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 8 Jun 2020 21:59:09 +0200 Subject: [PATCH 04/12] Disable presence and status_msg menu It currently causes severe performance issues in synapse as well as many random resets, so this is disabled until those issues are resolved. --- src/UserInfoWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp index bf59427c..e8e403bc 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp @@ -151,7 +151,11 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) void UserInfoWidget::contextMenuEvent(QContextMenuEvent *event) { +#if 0 // disable presence menu until issues in synapse are resolved menu->popup(event->globalPos()); +#else + Q_UNUSED(event); +#endif } void From 3baf11b5c488331b07a504b2e9f514b54b828a7e Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 8 Jun 2020 22:35:47 +0200 Subject: [PATCH 05/12] Fix unused capture --- src/UserInfoWidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp index e8e403bc..dcaf0d09 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp @@ -125,24 +125,24 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) ChatPage::instance()->setStatus(text); }); auto setAutoPresence = menu->addAction(tr("Set presence automatically")); - connect(setAutoPresence, &QAction::triggered, this, [this]() { + connect(setAutoPresence, &QAction::triggered, this, []() { ChatPage::instance()->userSettings()->setPresence( UserSettings::Presence::AutomaticPresence); ChatPage::instance()->setStatus(ChatPage::instance()->status()); }); auto setOnline = menu->addAction(tr("Online")); - connect(setOnline, &QAction::triggered, this, [this]() { + connect(setOnline, &QAction::triggered, this, []() { ChatPage::instance()->userSettings()->setPresence(UserSettings::Presence::Online); ChatPage::instance()->setStatus(ChatPage::instance()->status()); }); auto setUnavailable = menu->addAction(tr("Unavailable")); - connect(setUnavailable, &QAction::triggered, this, [this]() { + connect(setUnavailable, &QAction::triggered, this, []() { ChatPage::instance()->userSettings()->setPresence( UserSettings::Presence::Unavailable); ChatPage::instance()->setStatus(ChatPage::instance()->status()); }); auto setOffline = menu->addAction(tr("Offline")); - connect(setOffline, &QAction::triggered, this, [this]() { + connect(setOffline, &QAction::triggered, this, []() { ChatPage::instance()->userSettings()->setPresence(UserSettings::Presence::Offline); ChatPage::instance()->setStatus(ChatPage::instance()->status()); }); From b9631753dd30453ec559a5046369c987f216add0 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 9 Jun 2020 12:49:36 +0200 Subject: [PATCH 06/12] Reenable custom status messages This still leaves out setting a client to online/offline, since that seems to be causing the CPU issues with synapse. --- src/UserInfoWidget.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp index dcaf0d09..40a3221d 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp @@ -124,6 +124,8 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) if (ok && !text.isEmpty()) ChatPage::instance()->setStatus(text); }); + +#if 0 // disable presence menu until issues in synapse are resolved auto setAutoPresence = menu->addAction(tr("Set presence automatically")); connect(setAutoPresence, &QAction::triggered, this, []() { ChatPage::instance()->userSettings()->setPresence( @@ -146,16 +148,13 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) ChatPage::instance()->userSettings()->setPresence(UserSettings::Presence::Offline); ChatPage::instance()->setStatus(ChatPage::instance()->status()); }); +#endif } void UserInfoWidget::contextMenuEvent(QContextMenuEvent *event) { -#if 0 // disable presence menu until issues in synapse are resolved menu->popup(event->globalPos()); -#else - Q_UNUSED(event); -#endif } void From 0a23615dd7ea04466f52396da8bf71dbe4a51916 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 9 Jun 2020 13:29:24 +0200 Subject: [PATCH 07/12] Fix small formatting error --- src/ChatPage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 673fc9a2..1061535f 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -985,7 +985,7 @@ ChatPage::startInitialSync() nhlog::net()->info("trying initial sync"); mtx::http::SyncOpts opts; - opts.timeout = 0; + opts.timeout = 0; opts.set_presence = currentPresence(); http::client()->sync( From 488924c9b372d30814aec95a78448d9d60b877ee Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 11 Jun 2020 18:28:00 +0200 Subject: [PATCH 08/12] Allow deleting a status --- src/UserInfoWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UserInfoWidget.cpp b/src/UserInfoWidget.cpp index 40a3221d..f8e94431 100644 --- a/src/UserInfoWidget.cpp +++ b/src/UserInfoWidget.cpp @@ -121,7 +121,7 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) QLineEdit::Normal, ChatPage::instance()->status(), &ok); - if (ok && !text.isEmpty()) + if (ok) ChatPage::instance()->setStatus(text); }); From db93e6b8536efccaa6693536337740854d141b71 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 11 Jun 2020 18:37:09 +0200 Subject: [PATCH 09/12] Fix warning about not registered Presence type --- src/UserSettingsPage.cpp | 1 - src/main.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index 659e8ceb..0bba0506 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -49,7 +49,6 @@ UserSettings::UserSettings() { - qRegisterMetaType(); load(); } diff --git a/src/main.cpp b/src/main.cpp index ec4f638d..04ff5155 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -104,6 +104,9 @@ createCacheDirectory() int main(int argc, char *argv[]) { + // needed for settings so need to register before any settings are read to prevent warings + qRegisterMetaType(); + #if defined(Q_OS_LINUX) || defined(Q_OS_WIN) || defined(Q_OS_FREEBSD) if (qgetenv("QT_SCALE_FACTOR").size() == 0) { float factor = utils::scaleFactor(); From 150c9b1dbc4be490413fe1826c48e5d6d15146f0 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 11 Jun 2020 23:08:15 +0200 Subject: [PATCH 10/12] Fix scale factor setting --- src/main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 04ff5155..46691e6f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -107,6 +107,15 @@ main(int argc, char *argv[]) // needed for settings so need to register before any settings are read to prevent warings qRegisterMetaType(); + QCoreApplication::setApplicationName("nheko"); + QCoreApplication::setApplicationVersion(nheko::version); + QCoreApplication::setOrganizationName("nheko"); + QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + + // this needs to be after setting the application name. Or how would we find our settings + // file then? #if defined(Q_OS_LINUX) || defined(Q_OS_WIN) || defined(Q_OS_FREEBSD) if (qgetenv("QT_SCALE_FACTOR").size() == 0) { float factor = utils::scaleFactor(); @@ -116,12 +125,6 @@ main(int argc, char *argv[]) } #endif - QCoreApplication::setApplicationName("nheko"); - QCoreApplication::setApplicationVersion(nheko::version); - QCoreApplication::setOrganizationName("nheko"); - QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); SingleApplication app(argc, argv, false, From dbaf92734ce34fe6b424b9b06bdb4e129382e9ff Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Thu, 11 Jun 2020 22:22:16 -0400 Subject: [PATCH 11/12] Fix formatting --- src/UserSettingsPage.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp index 0bba0506..97c42c3e 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp @@ -47,10 +47,7 @@ #include "config/nheko.h" -UserSettings::UserSettings() -{ - load(); -} +UserSettings::UserSettings() { load(); } void UserSettings::load() From a96e6e5ecd38fbceeb3045e93adeb9393bf8d456 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Thu, 11 Jun 2020 22:28:28 -0400 Subject: [PATCH 12/12] Merge branch origin/master and update translations --- resources/langs/nheko_de.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_el.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_en.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_fi.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_fr.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_it.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_ja.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_nl.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_pl.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_ru.ts | 61 ++++++++++++++++++++++++++-------- resources/langs/nheko_zh_CN.ts | 61 ++++++++++++++++++++++++++-------- 11 files changed, 528 insertions(+), 143 deletions(-) diff --git a/resources/langs/nheko_de.ts b/resources/langs/nheko_de.ts index 351eec65..1ba57370 100644 --- a/resources/langs/nheko_de.ts +++ b/resources/langs/nheko_de.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. Du bist dem Raum beigetreten. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 Nutzer konnte nicht eingeladen werden: %1 - + Invited user: %1 Eingeladener Benutzer: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. Migrieren des Caches auf die aktuelle Version fehlgeschlagen. Das kann verschiedene Gründe als Ursache haben. Bitte lege einen Bugreport an und verwende in der Zwischenzeit eine ältere Version. Alternativ kannst du das Cache manuell entfernen. - + Room %1 created. Raum %1 erzeugt. @@ -68,7 +68,7 @@ Verbannung von %1 wurde aufgehoben. - + Failed to upload media. Please try again. Medienupload fehlgeschlagen. Bitte versuche es erneut. @@ -103,13 +103,13 @@ Fehler beim Setup der Verschlüsselungsschlüssel. Servermeldung: %1 %2. Bitte versuche es später erneut. - - + + Please try to login again: %1 Bitte melde dich erneut an: %1 - + Failed to join room: %1 Konnte Raum nicht betreten: %1 @@ -492,7 +492,7 @@ Beispiel: https://mein.server:8787 RoomInfo - + no version stored keine Version gespeichert @@ -921,7 +921,7 @@ Beispiel: https://mein.server:8787 Kein Raum geöffnet - + Close Schließen @@ -975,15 +975,50 @@ Beispiel: https://mein.server:8787 UserInfoWidget - + Logout Abmelden + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Ins Benachrichtigungsfeld minimieren diff --git a/resources/langs/nheko_el.ts b/resources/langs/nheko_el.ts index 1e612ea1..47405976 100644 --- a/resources/langs/nheko_el.ts +++ b/resources/langs/nheko_el.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ - - + + Please try to login again: %1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored @@ -917,7 +917,7 @@ Example: https://server.my:8787 - + Close @@ -971,15 +971,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Ελαχιστοποίηση diff --git a/resources/langs/nheko_en.ts b/resources/langs/nheko_en.ts index 91e8a061..db24f1fe 100644 --- a/resources/langs/nheko_en.ts +++ b/resources/langs/nheko_en.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 Failed to invite user: %1 - + Invited user: %1 Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. Room %1 created. @@ -68,7 +68,7 @@ Unbanned user: %1 - + Failed to upload media. Please try again. Failed to upload media. Please try again. @@ -103,13 +103,13 @@ Failed to setup encryption keys. Server response: %1 %2. Please try again later. - - + + Please try to login again: %1 Please try to login again: %1 - + Failed to join room: %1 Failed to join room: %1 @@ -492,7 +492,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored no version stored @@ -921,7 +921,7 @@ Example: https://server.my:8787 No room open - + Close Close @@ -975,15 +975,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout Logout + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Minimize to tray diff --git a/resources/langs/nheko_fi.ts b/resources/langs/nheko_fi.ts index 648bc7b9..9e95ed62 100644 --- a/resources/langs/nheko_fi.ts +++ b/resources/langs/nheko_fi.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ Salausavainten lähetys epäonnistui. Palvelimen vastaus: %1 %2. Ole hyvä ja yritä uudelleen myöhemmin. - - + + Please try to login again: %1 Ole hyvä ja yritä kirjautua sisään uudelleen: %1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored ei tallennettua versiota @@ -917,7 +917,7 @@ Example: https://server.my:8787 - + Close Sulje @@ -971,15 +971,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout Kirjaudu ulos + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Pienennä ilmoitusalueelle diff --git a/resources/langs/nheko_fr.ts b/resources/langs/nheko_fr.ts index e1daa315..bf9b36f6 100644 --- a/resources/langs/nheko_fr.ts +++ b/resources/langs/nheko_fr.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ - - + + Please try to login again: %1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored @@ -917,7 +917,7 @@ Example: https://server.my:8787 - + Close @@ -971,15 +971,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Réduire à la barre des tâches diff --git a/resources/langs/nheko_it.ts b/resources/langs/nheko_it.ts index 59132966..b5026408 100644 --- a/resources/langs/nheko_it.ts +++ b/resources/langs/nheko_it.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. Sei entrato in questa stanza. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 Impossibile invitare l'utente: %1 - + Invited user: %1 Invitato utente: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. Migrazione della cache alla versione corrente fallita. Questo può avere diverse cause. Per favore apri una issue e nel frattempo prova ad usare una versione più vecchia. In alternativa puoi provare a cancellare la cache manualmente. - + Room %1 created. Stanza %1 creata. @@ -68,7 +68,7 @@ Rimosso il ban dall'utente: %1 - + Failed to upload media. Please try again. Impossibile inviare il file multimediale. Per favore riprova. @@ -103,13 +103,13 @@ Impossibile configurare le chiavi crittografiche. Risposta del server: %1 %2. Per favore riprova in seguito. - - + + Please try to login again: %1 Per favore prova ad accedere nuovamente: %1 - + Failed to join room: %1 Impossibile accedere alla stanza: %1 @@ -492,7 +492,7 @@ Esempio: https://server.mio:8787 RoomInfo - + no version stored nessuna versione memorizzata @@ -921,7 +921,7 @@ Esempio: https://server.mio:8787 Nessuna stanza aperta - + Close Chiudi @@ -975,15 +975,50 @@ Esempio: https://server.mio:8787 UserInfoWidget - + Logout Disconnettiti + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Minimizza nella tray diff --git a/resources/langs/nheko_ja.ts b/resources/langs/nheko_ja.ts index beb3cbde..a806031b 100644 --- a/resources/langs/nheko_ja.ts +++ b/resources/langs/nheko_ja.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 ユーザーを招待できませんでした: %1 - + Invited user: %1 招待されたユーザー: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ 永久追放を解除されたユーザー: %1 - + Failed to upload media. Please try again. メディアをアップロードできませんでした。やり直して下さい。 @@ -103,13 +103,13 @@ 暗号化鍵を設定できませんでした。サーバーの応答: %1 %2. 後でやり直して下さい。 - - + + Please try to login again: %1 もう一度ログインしてみて下さい: %1 - + Failed to join room: %1 部屋に参加できませんでした: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored バージョンが保存されていません @@ -916,7 +916,7 @@ Example: https://server.my:8787 部屋が開いていません - + Close 閉じる @@ -970,15 +970,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout ログアウト + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray トレイへ最小化 diff --git a/resources/langs/nheko_nl.ts b/resources/langs/nheko_nl.ts index bd02caf6..8d6a9f68 100644 --- a/resources/langs/nheko_nl.ts +++ b/resources/langs/nheko_nl.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ - - + + Please try to login again: %1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored @@ -917,7 +917,7 @@ Example: https://server.my:8787 - + Close @@ -971,15 +971,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Minimaliseren naar systeemvak diff --git a/resources/langs/nheko_pl.ts b/resources/langs/nheko_pl.ts index c93aae67..934221a2 100644 --- a/resources/langs/nheko_pl.ts +++ b/resources/langs/nheko_pl.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ - - + + Please try to login again: %1 Spróbuj zalogować się ponownie: %1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored @@ -918,7 +918,7 @@ Example: https://server.my:8787 - + Close @@ -972,15 +972,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout Wyloguj + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Zminimalizuj do paska zadań diff --git a/resources/langs/nheko_ru.ts b/resources/langs/nheko_ru.ts index 3a900f9d..541b0df9 100644 --- a/resources/langs/nheko_ru.ts +++ b/resources/langs/nheko_ru.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ Не удалось настроить ключи шифрования. Ответ сервера:%1 %2. Пожалуйста, попробуйте позже. - - + + Please try to login again: %1 Повторите попытку входа: %1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored @@ -918,7 +918,7 @@ Example: https://server.my:8787 - + Close Закрыть @@ -972,15 +972,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout Выйти + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray Сворачивать в системную панель diff --git a/resources/langs/nheko_zh_CN.ts b/resources/langs/nheko_zh_CN.ts index ca7e04ca..545e098b 100644 --- a/resources/langs/nheko_zh_CN.ts +++ b/resources/langs/nheko_zh_CN.ts @@ -4,7 +4,7 @@ Cache - + You joined this room. @@ -12,23 +12,23 @@ ChatPage - + Failed to invite user: %1 - + Invited user: %1 - + Migrating the cache to the current version failed. This can have different reasons. Please open an issue and try to use an older version in the mean time. Alternatively you can try deleting the cache manually. - + Room %1 created. @@ -68,7 +68,7 @@ - + Failed to upload media. Please try again. @@ -103,13 +103,13 @@ - - + + Please try to login again: %1 请尝试再次登录:%1 - + Failed to join room: %1 @@ -488,7 +488,7 @@ Example: https://server.my:8787 RoomInfo - + no version stored @@ -916,7 +916,7 @@ Example: https://server.my:8787 - + Close @@ -970,15 +970,50 @@ Example: https://server.my:8787 UserInfoWidget - + Logout 登出 + + + Set custom status message + + + + + Custom status message + + + + + Status: + + + + + Set presence automatically + + + + + Online + + + + + Unavailable + + + + + Offline + + UserSettingsPage - + Minimize to tray 最小化至托盘