Merge pull request #189 from Nheko-Reborn/db-migrations

Db migrations
This commit is contained in:
DeepBlueV7.X 2020-05-03 01:56:06 +02:00 committed by GitHub
commit ccd55c70df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 439 additions and 153 deletions

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation>Nutzer konnte nicht eingeladen werden: %1</translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation>Eingeladener Benutzer: %1</translation>
</message>
@ -50,12 +50,32 @@
<translation>Verbannung von %1 wurde aufgehoben.</translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation>Medienupload fehlgeschlagen. Bitte versuche es erneut.</translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation>Wiederherstellung des OLM Accounts fehlgeschlagen. Bitte logge dich erneut ein.</translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>Bitte melde dich erneut an: %1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation>keine Version gespeichert</translation>
</message>
@ -368,7 +388,7 @@
<translation>Raum verlassen</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Akzeptieren</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation>-- Entschlüsselungsfehler (Fehler bei Kommunikation mit Datenbank) --</translation>
@ -489,7 +509,7 @@
<translation>-- Entschlüsselungsfehler (%1) --</translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation>Nachricht zurückziehen fehlgeschlagen: %1</translation>
</message>
@ -514,7 +534,7 @@
<translation>Datei speichern</translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation>-- Verschlüsseltes Event (keine Schlüssel zur Entschlüsselung gefunden) --</translation>
@ -526,7 +546,7 @@
<translation>-- Verschlüsseltes Event (Unbekannter Eventtyp) --</translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation>
@ -677,7 +697,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation>Antworten</translation>
</message>
@ -971,7 +991,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation>Gestern</translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation type="unfinished"></translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation type="unfinished"></translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation type="unfinished"></translation>
</message>
@ -368,7 +388,7 @@
<translation>Βγές</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Αποδοχή</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished"></translation>
@ -489,7 +509,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished"></translation>
</message>
@ -514,7 +534,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished"></translation>
@ -526,7 +546,7 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation type="unfinished">
@ -677,7 +697,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -971,7 +991,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation type="unfinished"></translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation>Failed to invite user: %1</translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation>Invited user: %1</translation>
</message>
@ -50,12 +50,32 @@
<translation>Unbanned user: %1</translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation>Failed to upload media. Please try again.</translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation>Failed to restore OLM account. Please login again.</translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>Please try to login again: %1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation>no version stored</translation>
</message>
@ -368,7 +388,7 @@
<translation>Leave room</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Accept</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation>-- Decryption Error (failed to communicate with DB) --</translation>
@ -489,7 +509,7 @@
<translation>-- Decryption Error (%1) --</translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation>Message redaction failed: %1</translation>
</message>
@ -514,7 +534,7 @@
<translation>Save file</translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation>-- Encrypted Event (No keys found for decryption) --</translation>
@ -526,7 +546,7 @@
<translation>-- Encrypted Event (Unknown event type) --</translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation>
@ -677,7 +697,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation>Reply</translation>
</message>
@ -971,7 +991,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation>Yesterday</translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation>OLM-tilin palauttaminen epäonnistui. Ole hyvä ja kirjaudu sisään uudelleen.</translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>Ole hyvä ja yritä kirjautua sisään uudelleen: %1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation>ei tallennettua versiota</translation>
</message>
@ -368,7 +388,7 @@
<translation>Poistu huoneesta</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Hyväksy</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished">-- Virhe purkaessa salausta (tietokannan kanssa kommunikointi epäonnistui) --</translation>
@ -489,7 +509,7 @@
<translation type="unfinished">-- Virhe purkaessa salausta (%1) --</translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished">Viestin poisto epäonnistui: %1</translation>
</message>
@ -514,7 +534,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished">-- Salattu viesti (salauksen purkuavaimia ei löydetty) --</translation>
@ -526,7 +546,7 @@
<translation type="unfinished">-- Salattu viesti (tuntematon viestityyppi) --</translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation>
@ -677,7 +697,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -971,7 +991,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation>Eilen</translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation type="unfinished"></translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation type="unfinished"></translation>
</message>
@ -356,7 +376,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation type="unfinished"></translation>
</message>
@ -369,7 +389,7 @@
<translation>Quitter le salon</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Accepter</translation>
</message>
@ -472,7 +492,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished"></translation>
@ -490,7 +510,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished"></translation>
</message>
@ -515,7 +535,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished"></translation>
@ -527,7 +547,7 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation type="unfinished">
@ -678,7 +698,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -972,7 +992,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation type="unfinished"></translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation>: %1</translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation>: %1</translation>
</message>
@ -50,12 +50,32 @@
<translation>: %1</translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation>OLMアカウントを復元できませんでした</translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>: %1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation></translation>
</message>
@ -368,7 +388,7 @@
<translation></translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation></translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation>-- () --</translation>
@ -489,7 +509,7 @@
<translation type="unfinished">-- (%1) --</translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation>: %1</translation>
</message>
@ -514,7 +534,7 @@
<translation></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished">-- () --</translation>
@ -526,7 +546,7 @@
<translation type="unfinished">-- () --</translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation>
@ -676,7 +696,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -970,7 +990,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation></translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation type="unfinished"></translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation type="unfinished"></translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation type="unfinished"></translation>
</message>
@ -368,7 +388,7 @@
<translation>Kamer verlaten</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Accepteren</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished"></translation>
@ -489,7 +509,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished"></translation>
</message>
@ -514,7 +534,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished"></translation>
@ -526,7 +546,7 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation type="unfinished">
@ -677,7 +697,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -971,7 +991,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation type="unfinished"></translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation>Nie udało się przywrócić konta OLM. Spróbuj zalogować się ponownie.</translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>Spróbuj zalogować się ponownie: %1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation type="unfinished"></translation>
</message>
@ -368,7 +388,7 @@
<translation>Opuść pokój</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Akceptuj</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished"></translation>
@ -489,7 +509,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished">Redagowanie wiadomości nie powiodło się: %1</translation>
</message>
@ -514,7 +534,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished"></translation>
@ -526,7 +546,7 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation type="unfinished">
@ -678,7 +698,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -972,7 +992,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation type="unfinished"></translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation>Не удалось восстановить учетную запись OLM. Пожалуйста, войдите снова.</translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>Повторите попытку входа: %1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation type="unfinished"></translation>
</message>
@ -368,7 +388,7 @@
<translation>Покинуть комнату</translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation>Принять</translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished"></translation>
@ -489,7 +509,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished">Ошибка редактирования сообщения: %1</translation>
</message>
@ -514,7 +534,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished"></translation>
@ -526,7 +546,7 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation type="unfinished">
@ -678,7 +698,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -973,7 +993,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation type="unfinished"></translation>
</message>

View file

@ -4,13 +4,13 @@
<context>
<name>ChatPage</name>
<message>
<location filename="../../src/ChatPage.cpp" line="+225"/>
<location filename="../../src/ChatPage.cpp" line="+226"/>
<source>Failed to invite user: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<location line="+866"/>
<location line="+888"/>
<source>Invited user: %1</source>
<translation type="unfinished"></translation>
</message>
@ -50,12 +50,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-791"/>
<location line="-813"/>
<source>Failed to upload media. Please try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+404"/>
<location line="+296"/>
<source>Cache migration failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>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</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Incompatible cache version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The cache on your disk is newer than this version of Nheko supports. Please update or clear your cache.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Failed to restore OLM account. Please login again.</source>
<translation> OLM </translation>
</message>
@ -71,7 +91,7 @@
</message>
<message>
<location line="+51"/>
<location line="+210"/>
<location line="+215"/>
<source>Please try to login again: %1</source>
<translation>%1</translation>
</message>
@ -355,7 +375,7 @@
<context>
<name>RoomInfo</name>
<message>
<location filename="../../src/Cache.cpp" line="+2311"/>
<location filename="../../src/Cache.cpp" line="+2213"/>
<source>no version stored</source>
<translation type="unfinished"></translation>
</message>
@ -368,7 +388,7 @@
<translation></translation>
</message>
<message>
<location line="+158"/>
<location line="+160"/>
<source>Accept</source>
<translation></translation>
</message>
@ -471,7 +491,7 @@
<context>
<name>TimelineModel</name>
<message>
<location filename="../../src/timeline/TimelineModel.cpp" line="+766"/>
<location filename="../../src/timeline/TimelineModel.cpp" line="+773"/>
<source>-- Decryption Error (failed to communicate with DB) --</source>
<comment>Placeholder, when the message can&apos;t be decrypted, because the DB access failed when trying to lookup the session.</comment>
<translation type="unfinished"></translation>
@ -489,7 +509,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+89"/>
<location line="+99"/>
<source>Message redaction failed: %1</source>
<translation type="unfinished">%1</translation>
</message>
@ -514,7 +534,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-600"/>
<location line="-610"/>
<source>-- Encrypted Event (No keys found for decryption) --</source>
<comment>Placeholder, when the message was not decrypted yet or can&apos;t be decrypted.</comment>
<translation type="unfinished"></translation>
@ -526,7 +546,7 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+650"/>
<location line="+660"/>
<source>%1 and %2 are typing.</source>
<comment>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.)</comment>
<translation type="unfinished">
@ -676,7 +696,7 @@
<context>
<name>TimelineView</name>
<message>
<location filename="../qml/TimelineView.qml" line="+48"/>
<location filename="../qml/TimelineView.qml" line="+52"/>
<source>Reply</source>
<translation type="unfinished"></translation>
</message>
@ -970,7 +990,7 @@
<context>
<name>descriptiveTime</name>
<message>
<location filename="../../src/Utils.cpp" line="+138"/>
<location filename="../../src/Utils.cpp" line="+141"/>
<source>Yesterday</source>
<translation type="unfinished"></translation>
</message>

View file

@ -36,7 +36,7 @@
//! Should be changed when a breaking change occurs in the cache format.
//! This will reset client's data.
static const std::string CURRENT_CACHE_FORMAT_VERSION("2018.09.21");
static const std::string CURRENT_CACHE_FORMAT_VERSION("2020.05.01");
static const std::string SECRET("secret");
static lmdb::val NEXT_BATCH_KEY("next_batch");
@ -665,8 +665,9 @@ Cache::deleteData()
}
}
//! migrates db to the current format
bool
Cache::isFormatValid()
Cache::runMigrations()
{
auto txn = lmdb::txn::begin(env_, nullptr, MDB_RDONLY);
@ -680,16 +681,61 @@ Cache::isFormatValid()
std::string stored_version(current_version.data(), current_version.size());
if (stored_version != CURRENT_CACHE_FORMAT_VERSION) {
nhlog::db()->warn("breaking changes in the cache format. stored: {}, current: {}",
stored_version,
CURRENT_CACHE_FORMAT_VERSION);
return false;
std::vector<std::pair<std::string, std::function<bool()>>> migrations{
{"2020.05.01",
[this]() {
try {
auto txn = lmdb::txn::begin(env_, nullptr);
auto pending_receipts =
lmdb::dbi::open(txn, "pending_receipts", MDB_CREATE);
lmdb::dbi_drop(txn, pending_receipts, true);
txn.commit();
} catch (const lmdb::error &) {
nhlog::db()->critical(
"Failed to delete pending_receipts database in migration!");
return false;
}
nhlog::db()->info("Successfully deleted pending receipts database.");
return true;
}},
};
for (const auto &[target_version, migration] : migrations) {
if (target_version > stored_version)
if (!migration()) {
nhlog::db()->critical("migration failure!");
return false;
}
}
setCurrentFormat();
return true;
}
cache::CacheVersion
Cache::formatVersion()
{
auto txn = lmdb::txn::begin(env_, nullptr, MDB_RDONLY);
lmdb::val current_version;
bool res = lmdb::dbi_get(txn, syncStateDb_, CACHE_FORMAT_VERSION_KEY, current_version);
txn.commit();
if (!res)
return cache::CacheVersion::Older;
std::string stored_version(current_version.data(), current_version.size());
if (stored_version < CURRENT_CACHE_FORMAT_VERSION)
return cache::CacheVersion::Older;
else if (stored_version > CURRENT_CACHE_FORMAT_VERSION)
return cache::CacheVersion::Older;
else
return cache::CacheVersion::Current;
}
void
Cache::setCurrentFormat()
{
@ -2468,10 +2514,17 @@ setup()
}
bool
isFormatValid()
runMigrations()
{
return instance_->isFormatValid();
return instance_->runMigrations();
}
cache::CacheVersion
formatVersion()
{
return instance_->formatVersion();
}
void
setCurrentFormat()
{

View file

@ -111,10 +111,15 @@ removeRoom(const QString &roomid);
void
setup();
bool
isFormatValid();
//! returns if the format is current, older or newer
cache::CacheVersion
formatVersion();
//! set the format version to the current version
void
setCurrentFormat();
//! migrates db to the current format
bool
runMigrations();
std::map<QString, mtx::responses::Timeline>
roomMessages();

View file

@ -8,6 +8,15 @@
#include <mtx/events/join_rules.hpp>
namespace cache {
enum class CacheVersion : int
{
Older = -1,
Current = 0,
Newer = 1,
};
}
struct RoomMember
{
QString user_id;

View file

@ -102,8 +102,9 @@ public:
void removeRoom(const std::string &roomid);
void setup();
bool isFormatValid();
cache::CacheVersion formatVersion();
void setCurrentFormat();
bool runMigrations();
std::map<QString, mtx::responses::Timeline> roomMessages();

View file

@ -17,6 +17,7 @@
#include <QApplication>
#include <QImageReader>
#include <QMessageBox>
#include <QSettings>
#include <QShortcut>
#include <QtConcurrent>
@ -642,20 +643,37 @@ ChatPage::bootstrap(QString userid, QString homeserver, QString token)
&NotificationsManager::removeNotification);
const bool isInitialized = cache::isInitialized();
const bool isValid = cache::isFormatValid();
const auto cacheVersion = cache::formatVersion();
if (!isInitialized) {
cache::setCurrentFormat();
} else if (isInitialized && !isValid) {
// TODO: Deleting session data but keep using the
// same device doesn't work.
cache::deleteData();
cache::init(userid);
cache::setCurrentFormat();
} else if (isInitialized) {
loadStateFromCache();
return;
} else {
if (cacheVersion == cache::CacheVersion::Current) {
loadStateFromCache();
return;
} else if (cacheVersion == cache::CacheVersion::Older) {
if (!cache::runMigrations()) {
QMessageBox::critical(
this,
tr("Cache migration failed!"),
tr("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"));
QCoreApplication::quit();
}
loadStateFromCache();
return;
} else if (cacheVersion == cache::CacheVersion::Newer) {
QMessageBox::critical(
this,
tr("Incompatible cache version"),
tr("The cache on your disk is newer than this version of Nheko "
"supports. Please update or clear your cache."));
QCoreApplication::quit();
return;
}
}
} catch (const lmdb::error &e) {