diff --git a/CHANGELOG.md b/CHANGELOG.md
index b88900f3..bdd4363c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,11 +2,16 @@
## [0.7.1] -- unreleased
+### Features
+
+- Show decrypted message source (helps debugging)
+
### Bugfixes
- Fix display of images sent by the user (thank you, wnereiz and not-chicken for reporting)
- Fix crash when trying to maximize image, that wasn't downloaded yet.
- Fix Binding restorMode flooding logs on Qt 5.14.2+
+- Fix with some qml styles hidden menu items leave empty space
## [0.7.0] -- 2020-04-19
diff --git a/resources/langs/nheko_de.ts b/resources/langs/nheko_de.ts
index bd65e867..259b5c86 100644
--- a/resources/langs/nheko_de.ts
+++ b/resources/langs/nheko_de.ts
@@ -327,12 +327,12 @@
REGISTRIEREN
-
+ Keine unterstützten Registrierungsmethoden!
-
+ Ungültiger Benutzername
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.-- Entschlüsselungsfehler (Fehler bei Kommunikation mit Datenbank) --
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.-- Entschlüsselungsfehler (Fehler bei Suche nach megolm Schlüsseln in Datenbank) --
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.-- Entschlüsselungsfehler (%1) --
-
+ Nachricht zurückziehen fehlgeschlagen: %1
-
+ Bild speichern
@@ -514,19 +514,19 @@
Datei speichern
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.-- Verschlüsseltes Event (keine Schlüssel zur Entschlüsselung gefunden) --
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.-- Verschlüsseltes Event (Unbekannter Eventtyp) --
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -677,7 +677,7 @@
TimelineView
-
+ Antworten
@@ -694,7 +694,12 @@
- Zeige rohen Nachrichteninhalt
+ Zeige rohen Nachrichteninhalt
+
+
+
+
+ Zeige rohen, entschlüsselten Nachrichteninhalt
@@ -702,7 +707,7 @@
Nachricht löschen
-
+ Speichern unter...
diff --git a/resources/langs/nheko_el.ts b/resources/langs/nheko_el.ts
index 1a7889d5..4ce7e6e4 100644
--- a/resources/langs/nheko_el.ts
+++ b/resources/langs/nheko_el.ts
@@ -327,12 +327,12 @@
ΕΓΓΡΑΦΗ
-
+
-
+ Μη έγκυρο όνομα χρήστη
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
-
+
-
+ Αποθήκευση Εικόνας
@@ -514,19 +514,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -677,7 +677,7 @@
TimelineView
-
+
@@ -696,13 +696,18 @@
+
+
+
+
+
-
+
diff --git a/resources/langs/nheko_en.ts b/resources/langs/nheko_en.ts
index f75068fa..f7b3b093 100644
--- a/resources/langs/nheko_en.ts
+++ b/resources/langs/nheko_en.ts
@@ -327,12 +327,12 @@
REGISTER
-
+ No supported registration flows!
-
+ Invalid username
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.-- Decryption Error (failed to communicate with DB) --
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.-- Decryption Error (failed to retrieve megolm keys from db) --
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.-- Decryption Error (%1) --
-
+ Message redaction failed: %1
-
+ Save image
@@ -514,19 +514,19 @@
Save file
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.-- Encrypted Event (No keys found for decryption) --
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.-- Encrypted Event (Unknown event type) --
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -677,7 +677,7 @@
TimelineView
-
+ Reply
@@ -696,13 +696,18 @@
View raw message
+
+
+
+
+ Redact message
-
+ Save as
diff --git a/resources/langs/nheko_fi.ts b/resources/langs/nheko_fi.ts
index b7230f63..eab4771b 100644
--- a/resources/langs/nheko_fi.ts
+++ b/resources/langs/nheko_fi.ts
@@ -327,12 +327,12 @@
REKISTERÖIDY
-
+
-
+ Epäkelpo käyttäjänimi
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.-- Virhe purkaessa salausta (tietokannan kanssa kommunikointi epäonnistui) --
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.-- Virhe purkaessa salausta (megolm-avaimien hakeminen tietokannasta epäonnistui) --
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.-- Virhe purkaessa salausta (%1) --
-
+ Viestin poisto epäonnistui: %1
-
+ Tallenna kuva
@@ -514,19 +514,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.-- Salattu viesti (salauksen purkuavaimia ei löydetty) --
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.-- Salattu viesti (tuntematon viestityyppi) --
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -677,7 +677,7 @@
TimelineView
-
+
@@ -696,13 +696,18 @@
+
+
+
+
+
-
+
diff --git a/resources/langs/nheko_fr.ts b/resources/langs/nheko_fr.ts
index 0ea3540f..472f8c7f 100644
--- a/resources/langs/nheko_fr.ts
+++ b/resources/langs/nheko_fr.ts
@@ -328,12 +328,12 @@
S'ENREGISTRER
-
+
-
+ Nom d'utilisateur invalide
@@ -472,30 +472,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
-
+
-
+ Enregistrer l'image
@@ -515,19 +515,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -678,7 +678,7 @@
TimelineView
-
+
@@ -697,13 +697,18 @@
+
+
+
+
+
-
+
diff --git a/resources/langs/nheko_ja.ts b/resources/langs/nheko_ja.ts
index dc8d4b03..d3194b42 100644
--- a/resources/langs/nheko_ja.ts
+++ b/resources/langs/nheko_ja.ts
@@ -327,12 +327,12 @@
登録
-
+
-
+ 無効なユーザー名です
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.-- 復号エラー (データベースと通信できませんでした) --
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.-- 復号エラー (データベースからmegolm鍵を取得できませんでした) --
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.-- 復号エラー (%1) --
-
+ メッセージを編集できませんでした: %1
-
+ 画像を保存
@@ -514,19 +514,19 @@
ファイルを保存
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.-- 暗号化イベント (復号鍵が見つかりません) --
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.-- 暗号化イベント (不明なイベント型です) --
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -676,7 +676,7 @@
TimelineView
-
+ 返信
@@ -695,13 +695,18 @@
ソースを見る
+
+
+
+
+ メッセージを編集
-
+ 名前を付けて保存
diff --git a/resources/langs/nheko_nl.ts b/resources/langs/nheko_nl.ts
index cfd01d2f..cb4f68e8 100644
--- a/resources/langs/nheko_nl.ts
+++ b/resources/langs/nheko_nl.ts
@@ -327,12 +327,12 @@
REGISTREREN
-
+
-
+ Ongeldige gebruikersnaam
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
-
+
-
+ Afbeelding opslaan
@@ -514,19 +514,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -677,7 +677,7 @@
TimelineView
-
+
@@ -696,13 +696,18 @@
+
+
+
+
+
-
+
diff --git a/resources/langs/nheko_pl.ts b/resources/langs/nheko_pl.ts
index 11183d23..9fb3bae6 100644
--- a/resources/langs/nheko_pl.ts
+++ b/resources/langs/nheko_pl.ts
@@ -327,12 +327,12 @@
ZAREJESTRUJ
-
+
-
+ Nieprawidłowa nazwa użytkownika
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
-
+ Redagowanie wiadomości nie powiodło się: %1
-
+ Zapisz obraz
@@ -514,19 +514,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -678,7 +678,7 @@
TimelineView
-
+
@@ -697,13 +697,18 @@
+
+
+
+
+
-
+
diff --git a/resources/langs/nheko_ru.ts b/resources/langs/nheko_ru.ts
index 0facf794..f48fccf3 100644
--- a/resources/langs/nheko_ru.ts
+++ b/resources/langs/nheko_ru.ts
@@ -327,12 +327,12 @@
РЕГИСТРАЦИЯ
-
+
-
+ Некорректное имя пользователя
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
-
+ Ошибка редактирования сообщения: %1
-
+ Сохранить изображение
@@ -514,19 +514,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -678,7 +678,7 @@
TimelineView
-
+
@@ -697,13 +697,18 @@
+
+
+
+
+
-
+
diff --git a/resources/langs/nheko_zh_CN.ts b/resources/langs/nheko_zh_CN.ts
index aa300707..63b67734 100644
--- a/resources/langs/nheko_zh_CN.ts
+++ b/resources/langs/nheko_zh_CN.ts
@@ -327,12 +327,12 @@
注册
-
+
-
+ 无效的用户名
@@ -471,30 +471,30 @@
TimelineModel
-
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
-
+ Placeholder, when the message can't be decrypted, because the DB access failed.
-
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
-
+ 删除消息失败:%1
-
+ 保存图像
@@ -514,19 +514,19 @@
-
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
-
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
-
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
@@ -676,7 +676,7 @@
TimelineView
-
+
@@ -695,13 +695,18 @@
+
+
+
+
+
-
+
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index e13cde28..05c69112 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -17,11 +17,11 @@ MouseArea {
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
if (mouse.button === Qt.RightButton)
- messageContextMenu.show(model.id, model.type, row)
+ messageContextMenu.show(model.id, model.type, model.isEncrypted, row)
}
onPressAndHold: {
if (mouse.source === Qt.MouseEventNotSynthesized)
- messageContextMenu.show(model.id, model.type, row)
+ messageContextMenu.show(model.id, model.type, model.isEncrypted, row)
}
RowLayout {
@@ -97,8 +97,7 @@ MouseArea {
ToolTip.visible: hovered
ToolTip.text: qsTr("Options")
- onClicked: messageContextMenu.show(model.id, model.type, optionsButton)
-
+ onClicked: messageContextMenu.show(model.id, model.type, model.isEncrypted, optionsButton)
}
Label {
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 86b511b2..cad341b5 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -33,14 +33,16 @@ Page {
id: messageContextMenu
modal: true
- function show(eventId_, eventType_, showAt) {
+ function show(eventId_, eventType_, isEncrypted_, showAt) {
eventId = eventId_
eventType = eventType_
+ isEncrypted = isEncrypted_
popup(showAt)
}
property string eventId
property int eventType
+ property bool isEncrypted
MenuItem {
text: qsTr("Reply")
@@ -57,12 +59,19 @@ Page {
text: qsTr("View raw message")
onTriggered: chat.model.viewRawMessage(messageContextMenu.eventId)
}
+ MenuItem {
+ visible: messageContextMenu.isEncrypted
+ height: visible ? implicitHeight : 0
+ text: qsTr("View decrypted raw message")
+ onTriggered: chat.model.viewDecryptedRawMessage(messageContextMenu.eventId)
+ }
MenuItem {
text: qsTr("Redact message")
onTriggered: chat.model.redactEvent(messageContextMenu.eventId)
}
MenuItem {
visible: messageContextMenu.eventType == MtxEvent.ImageMessage || messageContextMenu.eventType == MtxEvent.VideoMessage || messageContextMenu.eventType == MtxEvent.AudioMessage || messageContextMenu.eventType == MtxEvent.FileMessage || messageContextMenu.eventType == MtxEvent.Sticker
+ height: visible ? implicitHeight : 0
text: qsTr("Save as")
onTriggered: timelineManager.timeline.saveMedia(messageContextMenu.eventId)
}
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 7e124f47..bb793945 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -697,7 +697,20 @@ TimelineModel::viewRawMessage(QString id) const
}
void
+TimelineModel::viewDecryptedRawMessage(QString id) const
+{
+ auto event = events.value(id);
+ if (auto e =
+ std::get_if>(&event)) {
+ event = decryptEvent(*e).event;
+ }
+ std::string ev = utils::serialize_event(event).dump(4);
+ auto dialog = new dialogs::RawMessage(QString::fromStdString(ev));
+ Q_UNUSED(dialog);
+}
+
+void
TimelineModel::openUserProfile(QString userid) const
{
MainWindow::instance()->openUserProfile(userid, room_id_);
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index bb84bcd8..84e9ec26 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -179,6 +179,7 @@ public:
Q_INVOKABLE QString escapeEmoji(QString str) const;
Q_INVOKABLE void viewRawMessage(QString id) const;
+ Q_INVOKABLE void viewDecryptedRawMessage(QString id) const;
Q_INVOKABLE void openUserProfile(QString userid) const;
Q_INVOKABLE void replyAction(QString id);
Q_INVOKABLE void readReceiptsAction(QString id) const;