diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-05-18 03:30:04 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-05-18 04:23:36 +0200 |
commit | 7de1fc62e8a90bc571b342e8990e3890f7f5ffc1 (patch) | |
tree | 7873ec3fae9e2bb64e558cf77263d5a043de56fc | |
parent | Merge pull request #202 from aaronraimist/brew-libolm (diff) | |
download | nheko-7de1fc62e8a90bc571b342e8990e3890f7f5ffc1.tar.xz |
Tag rooms via context menu
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | io.github.NhekoReborn.Nheko.json | 4 | ||||
-rw-r--r-- | resources/langs/nheko_de.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_el.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_en.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_fi.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_fr.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_ja.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_nl.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_pl.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_ru.ts | 73 | ||||
-rw-r--r-- | resources/langs/nheko_zh_CN.ts | 73 | ||||
-rw-r--r-- | src/Cache.cpp | 6 | ||||
-rw-r--r-- | src/ChatPage.h | 2 | ||||
-rw-r--r-- | src/CommunitiesList.cpp | 12 | ||||
-rw-r--r-- | src/CommunitiesList.h | 1 | ||||
-rw-r--r-- | src/CommunitiesListItem.cpp | 2 | ||||
-rw-r--r-- | src/RoomInfoListItem.cpp | 105 |
18 files changed, 747 insertions, 117 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 669ce980..b5b046f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,7 +332,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG 1018c0822b80cdfc5d6b589fe94d1fd759113ef6 + GIT_TAG f5c78f4331b62a1e25a2d839cb38b07bb9bd7829 ) FetchContent_MakeAvailable(MatrixClient) else() diff --git a/io.github.NhekoReborn.Nheko.json b/io.github.NhekoReborn.Nheko.json index 3de04370..50fa3b33 100644 --- a/io.github.NhekoReborn.Nheko.json +++ b/io.github.NhekoReborn.Nheko.json @@ -146,9 +146,9 @@ "name": "mtxclient", "sources": [ { - "sha256": "537f4e6b280f351ad950cd6598c2407505a55f0d6c856b4ff97a9c59fc6fdb7a", + "sha256": "16203a92b03c488178b31bedca9d9015b1d406443f7e5363a2e09171e50f8dfc", "type": "archive", - "url": "https://github.com/Nheko-Reborn/mtxclient/archive/1018c0822b80cdfc5d6b589fe94d1fd759113ef6.tar.gz" + "url": "https://github.com/Nheko-Reborn/mtxclient/archive/f5c78f4331b62a1e25a2d839cb38b07bb9bd7829.tar.gz" } ] }, diff --git a/resources/langs/nheko_de.ts b/resources/langs/nheko_de.ts index a05bdf4d..341bd01f 100644 --- a/resources/langs/nheko_de.ts +++ b/resources/langs/nheko_de.ts @@ -445,12 +445,58 @@ Beispiel: https://mein.server:8787</translation> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Raum verlassen</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Akzeptieren</translation> </message> @@ -751,7 +797,7 @@ Beispiel: https://mein.server:8787</translation> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation>Antworten</translation> </message> @@ -764,7 +810,7 @@ Beispiel: https://mein.server:8787</translation> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation>Antworten</translation> </message> @@ -804,7 +850,7 @@ Beispiel: https://mein.server:8787</translation> <translation>Kein Raum geöffnet</translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation>Schließen</translation> </message> @@ -866,7 +912,7 @@ Beispiel: https://mein.server:8787</translation> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Ins Benachrichtigungsfeld minimieren</translation> </message> @@ -921,6 +967,11 @@ Beispiel: https://mein.server:8787</translation> <translation>Desktopbenachrichtigungen</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation>Skalierungsfaktor</translation> @@ -951,7 +1002,7 @@ Beispiel: https://mein.server:8787</translation> <translation>Gerätefingerabdruck</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation>Sitzungsschlüssel</translation> </message> @@ -971,22 +1022,22 @@ Beispiel: https://mein.server:8787</translation> <translation>VERSCHLÜSSELUNG</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>ALLGEMEINES</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation>OBERFLÄCHE</translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation>Emojischriftart</translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation>Öffne Sessions Datei</translation> </message> diff --git a/resources/langs/nheko_el.ts b/resources/langs/nheko_el.ts index a6e4ff7d..b84b1b1d 100644 --- a/resources/langs/nheko_el.ts +++ b/resources/langs/nheko_el.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Βγές</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Αποδοχή</translation> </message> @@ -747,7 +793,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -760,7 +806,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -800,7 +846,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished"></translation> </message> @@ -862,7 +908,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Ελαχιστοποίηση</translation> </message> @@ -917,6 +963,11 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation type="unfinished"></translation> @@ -947,7 +998,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation type="unfinished"></translation> </message> @@ -967,22 +1018,22 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>ΓΕΝΙΚΑ</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation type="unfinished"></translation> </message> diff --git a/resources/langs/nheko_en.ts b/resources/langs/nheko_en.ts index 1fd9b86c..72fbc8ad 100644 --- a/resources/langs/nheko_en.ts +++ b/resources/langs/nheko_en.ts @@ -445,12 +445,58 @@ Example: https://server.my:8787</translation> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Leave room</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Accept</translation> </message> @@ -751,7 +797,7 @@ Example: https://server.my:8787</translation> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation>Reply</translation> </message> @@ -764,7 +810,7 @@ Example: https://server.my:8787</translation> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation>Reply</translation> </message> @@ -804,7 +850,7 @@ Example: https://server.my:8787</translation> <translation>No room open</translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation>Close</translation> </message> @@ -866,7 +912,7 @@ Example: https://server.my:8787</translation> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Minimize to tray</translation> </message> @@ -921,6 +967,11 @@ Example: https://server.my:8787</translation> <translation>Desktop notifications</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation>Scale factor</translation> @@ -951,7 +1002,7 @@ Example: https://server.my:8787</translation> <translation>Device Fingerprint</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation>Session Keys</translation> </message> @@ -971,22 +1022,22 @@ Example: https://server.my:8787</translation> <translation>ENCRYPTION</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>GENERAL</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation>INTERFACE</translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation>Emoji Font Family</translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation>Open Sessions File</translation> </message> diff --git a/resources/langs/nheko_fi.ts b/resources/langs/nheko_fi.ts index 069fb6b2..271b45c4 100644 --- a/resources/langs/nheko_fi.ts +++ b/resources/langs/nheko_fi.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Poistu huoneesta</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Hyväksy</translation> </message> @@ -747,7 +793,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -760,7 +806,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -800,7 +846,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished">Sulje</translation> </message> @@ -862,7 +908,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Pienennä ilmoitusalueelle</translation> </message> @@ -917,6 +963,11 @@ Example: https://server.my:8787</source> <translation>Työpöytäilmoitukset</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation>Mittakerroin</translation> @@ -947,7 +998,7 @@ Example: https://server.my:8787</source> <translation>Laitteen sormenjälki</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation>Istunnon avaimet</translation> </message> @@ -967,22 +1018,22 @@ Example: https://server.my:8787</source> <translation>SALAUS</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>YLEISET ASETUKSET</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation>Avaa Istuntoavaintiedosto</translation> </message> diff --git a/resources/langs/nheko_fr.ts b/resources/langs/nheko_fr.ts index d50b5fb8..4fcb34dd 100644 --- a/resources/langs/nheko_fr.ts +++ b/resources/langs/nheko_fr.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Quitter le salon</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Accepter</translation> </message> @@ -747,7 +793,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -760,7 +806,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -800,7 +846,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished"></translation> </message> @@ -862,7 +908,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Réduire à la barre des tâches</translation> </message> @@ -917,6 +963,11 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation type="unfinished"></translation> @@ -947,7 +998,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation type="unfinished"></translation> </message> @@ -967,22 +1018,22 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>GÉNÉRAL</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation type="unfinished"></translation> </message> diff --git a/resources/langs/nheko_ja.ts b/resources/langs/nheko_ja.ts index 63522065..5d080342 100644 --- a/resources/langs/nheko_ja.ts +++ b/resources/langs/nheko_ja.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>部屋を出る</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>容認</translation> </message> @@ -746,7 +792,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation>返信</translation> </message> @@ -759,7 +805,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished">返信</translation> </message> @@ -799,7 +845,7 @@ Example: https://server.my:8787</source> <translation>部屋が開いていません</translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation>閉じる</translation> </message> @@ -861,7 +907,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>トレイへ最小化</translation> </message> @@ -916,6 +962,11 @@ Example: https://server.my:8787</source> <translation>デスクトップ通知</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation>尺度係数</translation> @@ -946,7 +997,7 @@ Example: https://server.my:8787</source> <translation>デバイスの指紋</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation>セッション鍵</translation> </message> @@ -966,22 +1017,22 @@ Example: https://server.my:8787</source> <translation>暗号化</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>全般</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation>セッションファイルを開く</translation> </message> diff --git a/resources/langs/nheko_nl.ts b/resources/langs/nheko_nl.ts index 2c3eeee3..31490bc3 100644 --- a/resources/langs/nheko_nl.ts +++ b/resources/langs/nheko_nl.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Kamer verlaten</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Accepteren</translation> </message> @@ -747,7 +793,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -760,7 +806,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -800,7 +846,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished"></translation> </message> @@ -862,7 +908,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Minimaliseren naar systeemvak</translation> </message> @@ -917,6 +963,11 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation type="unfinished"></translation> @@ -947,7 +998,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation type="unfinished"></translation> </message> @@ -967,22 +1018,22 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>ALGEMEEN</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation type="unfinished"></translation> </message> diff --git a/resources/langs/nheko_pl.ts b/resources/langs/nheko_pl.ts index f68ca8b3..e77f2f00 100644 --- a/resources/langs/nheko_pl.ts +++ b/resources/langs/nheko_pl.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Opuść pokój</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Akceptuj</translation> </message> @@ -748,7 +794,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -761,7 +807,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -801,7 +847,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished"></translation> </message> @@ -863,7 +909,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Zminimalizuj do paska zadań</translation> </message> @@ -918,6 +964,11 @@ Example: https://server.my:8787</source> <translation>Powiadomienia na pulpicie</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation type="unfinished"></translation> @@ -948,7 +999,7 @@ Example: https://server.my:8787</source> <translation>Odcisk palca urządzenia</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation type="unfinished"></translation> </message> @@ -968,22 +1019,22 @@ Example: https://server.my:8787</source> <translation>SZYFROWANIE</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>OGÓLNE</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation type="unfinished"></translation> </message> diff --git a/resources/langs/nheko_ru.ts b/resources/langs/nheko_ru.ts index 95f75081..f9da93b7 100644 --- a/resources/langs/nheko_ru.ts +++ b/resources/langs/nheko_ru.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>Покинуть комнату</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>Принять</translation> </message> @@ -748,7 +794,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -761,7 +807,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -801,7 +847,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished">Закрыть</translation> </message> @@ -863,7 +909,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>Сворачивать в системную панель</translation> </message> @@ -918,6 +964,11 @@ Example: https://server.my:8787</source> <translation>Уведомления на рабочем столе</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation>Масштаб</translation> @@ -948,7 +999,7 @@ Example: https://server.my:8787</source> <translation>Отпечаток устройства</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation>Ключи сеанса</translation> </message> @@ -968,22 +1019,22 @@ Example: https://server.my:8787</source> <translation>ШИФРОВАНИЕ</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>ГЛАВНОЕ</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation>Открыть файл сеансов</translation> </message> diff --git a/resources/langs/nheko_zh_CN.ts b/resources/langs/nheko_zh_CN.ts index 6b6c0646..27e5c3cd 100644 --- a/resources/langs/nheko_zh_CN.ts +++ b/resources/langs/nheko_zh_CN.ts @@ -441,12 +441,58 @@ Example: https://server.my:8787</source> <context> <name>RoomInfoListItem</name> <message> - <location filename="../../src/RoomInfoListItem.cpp" line="+98"/> + <location filename="../../src/RoomInfoListItem.cpp" line="+102"/> <source>Leave room</source> <translation>离开聊天室</translation> </message> <message> - <location line="+160"/> + <location line="+7"/> + <source>Tag room as:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Favourite</source> + <comment>Standard matrix tag for favourites</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Low Priority</source> + <comment>Standard matrix tag for low priority rooms</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Server Notice</source> + <comment>Standard matrix tag for server notices</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Adds or removes the specified tag.</source> + <comment>WhatsThis hint for tag menu actions</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+38"/> + <source>New tag...</source> + <comment>Add a new tag to the room</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Tag</source> + <comment>Tag name prompt title</comment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Tag:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+173"/> <source>Accept</source> <translation>接受</translation> </message> @@ -746,7 +792,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineRow</name> <message> - <location filename="../qml/TimelineRow.qml" line="+88"/> + <location filename="../qml/TimelineRow.qml" line="+92"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -759,7 +805,7 @@ Example: https://server.my:8787</source> <context> <name>TimelineView</name> <message> - <location filename="../qml/TimelineView.qml" line="+53"/> + <location filename="../qml/TimelineView.qml" line="+54"/> <source>Reply</source> <translation type="unfinished"></translation> </message> @@ -799,7 +845,7 @@ Example: https://server.my:8787</source> <translation type="unfinished"></translation> </message> <message> - <location line="+256"/> + <location line="+257"/> <source>Close</source> <translation type="unfinished"></translation> </message> @@ -861,7 +907,7 @@ Example: https://server.my:8787</source> <context> <name>UserSettingsPage</name> <message> - <location filename="../../src/UserSettingsPage.cpp" line="+335"/> + <location filename="../../src/UserSettingsPage.cpp" line="+339"/> <source>Minimize to tray</source> <translation>最小化至托盘</translation> </message> @@ -916,6 +962,11 @@ Example: https://server.my:8787</source> <translation>桌面通知</translation> </message> <message> + <location line="+1"/> + <source>Highlight message on hover</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+5"/> <source>Scale factor</source> <translation type="unfinished"></translation> @@ -946,7 +997,7 @@ Example: https://server.my:8787</source> <translation>设备指纹</translation> </message> <message> - <location line="-59"/> + <location line="-60"/> <source>Session Keys</source> <translation>会话密钥</translation> </message> @@ -966,22 +1017,22 @@ Example: https://server.my:8787</source> <translation>加密</translation> </message> <message> - <location line="-63"/> + <location line="-64"/> <source>GENERAL</source> <translation>通用</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>INTERFACE</source> <translation type="unfinished"></translation> </message> <message> - <location line="+108"/> + <location line="+109"/> <source>Emoji Font Family</source> <translation type="unfinished"></translation> </message> <message> - <location line="+158"/> + <location line="+163"/> <source>Open Sessions File</source> <translation>打开会话文件</translation> </message> diff --git a/src/Cache.cpp b/src/Cache.cpp index 3a388bb9..1061e60e 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -915,8 +915,8 @@ Cache::saveState(const mtx::responses::Sync &res) bool has_new_tags = false; for (const auto &evt : room.second.account_data.events) { // for now only fetch tag events - if (std::holds_alternative<Event<account_data::Tag>>(evt)) { - auto tags_evt = std::get<Event<account_data::Tag>>(evt); + if (std::holds_alternative<Event<account_data::Tags>>(evt)) { + auto tags_evt = std::get<Event<account_data::Tags>>(evt); has_new_tags = true; for (const auto &tag : tags_evt.content.tags) { updatedInfo.tags.push_back(tag.first); @@ -1081,7 +1081,7 @@ Cache::roomsWithTagUpdates(const mtx::responses::Sync &res) for (const auto &room : res.rooms.join) { bool hasUpdates = false; for (const auto &evt : room.second.account_data.events) { - if (std::holds_alternative<Event<account_data::Tag>>(evt)) { + if (std::holds_alternative<Event<account_data::Tags>>(evt)) { hasUpdates = true; } } diff --git a/src/ChatPage.h b/src/ChatPage.h index 46630692..83b4e76d 100644 --- a/src/ChatPage.h +++ b/src/ChatPage.h @@ -77,6 +77,8 @@ public: QSharedPointer<UserSettings> userSettings() { return userSettings_; } void deleteConfigs(); + CommunitiesList *communitiesList() { return communitiesList_; } + //! Calculate the width of the message timeline. uint64_t timelineWidth(); bool isSideBarExpanded(); diff --git a/src/CommunitiesList.cpp b/src/CommunitiesList.cpp index bb57ca40..8a938646 100644 --- a/src/CommunitiesList.cpp +++ b/src/CommunitiesList.cpp @@ -257,6 +257,18 @@ CommunitiesList::roomList(const QString &id) const return {}; } +std::vector<std::string> +CommunitiesList::currentTags() const +{ + std::vector<std::string> tags; + for (auto &entry : communities_) { + CommunitiesListItem *item = entry.second.data(); + if (item->is_tag()) + tags.push_back(entry.first.mid(4).toStdString()); + } + return tags; +} + void CommunitiesList::sortEntries() { diff --git a/src/CommunitiesList.h b/src/CommunitiesList.h index d3cbeeff..63f7af07 100644 --- a/src/CommunitiesList.h +++ b/src/CommunitiesList.h @@ -28,6 +28,7 @@ public: void syncTags(const std::map<QString, RoomInfo> &info); void setTagsForRoom(const QString &id, const std::vector<std::string> &tags); + std::vector<std::string> currentTags() const; signals: void communityChanged(const QString &id); diff --git a/src/CommunitiesListItem.cpp b/src/CommunitiesListItem.cpp index 274271e5..c56c74a2 100644 --- a/src/CommunitiesListItem.cpp +++ b/src/CommunitiesListItem.cpp @@ -137,6 +137,8 @@ CommunitiesListItem::updateTooltip() setToolTip(tr("Favourite rooms")); else if (tag == "m.lowpriority") setToolTip(tr("Low priority rooms")); + else if (tag == "m.server_notice") + setToolTip(tr("Server Notices", "Tag translation for m.server_notice")); else if (tag.startsWith("u.")) setToolTip(tag.right(tag.size() - 2) + tr(" (tag)")); else diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp index ee8d532d..ad774360 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp @@ -16,6 +16,7 @@ */ #include <QDateTime> +#include <QInputDialog> #include <QMouseEvent> #include <QPainter> #include <QSettings> @@ -23,7 +24,10 @@ #include "AvatarProvider.h" #include "Cache.h" +#include "ChatPage.h" #include "Config.h" +#include "Logging.h" +#include "MatrixClient.h" #include "RoomInfoListItem.h" #include "Splitter.h" #include "UserSettingsPage.h" @@ -97,7 +101,106 @@ RoomInfoListItem::init(QWidget *parent) menu_ = new Menu(this); leaveRoom_ = new QAction(tr("Leave room"), this); connect(leaveRoom_, &QAction::triggered, this, [this]() { emit leaveRoom(roomId_); }); - menu_->addAction(leaveRoom_); + + connect(menu_, &QMenu::aboutToShow, this, [this]() { + menu_->clear(); + menu_->addAction(leaveRoom_); + + menu_->addSection(QIcon(":/icons/icons/ui/tag.png"), tr("Tag room as:")); + + auto roomInfo = cache::singleRoomInfo(roomId_.toStdString()); + + auto tags = ChatPage::instance()->communitiesList()->currentTags(); + + // add default tag, remove server notice tag + if (std::find(tags.begin(), tags.end(), "m.favourite") == tags.end()) + tags.push_back("m.favourite"); + if (std::find(tags.begin(), tags.end(), "m.lowpriority") == tags.end()) + tags.push_back("m.lowpriority"); + if (auto it = std::find(tags.begin(), tags.end(), "m.server_notice"); + it != tags.end()) + tags.erase(it); + + for (const auto &tag : tags) { + QString tagName; + if (tag == "m.favourite") + tagName = tr("Favourite", "Standard matrix tag for favourites"); + else if (tag == "m.lowpriority") + tagName = + tr("Low Priority", "Standard matrix tag for low priority rooms"); + else if (tag == "m.server_notice") + tagName = + tr("Server Notice", "Standard matrix tag for server notices"); + else if ((tag.size() > 2 && tag.substr(0, 2) == "u.") || + tag.find(".") != + std::string::npos) // tag manager creates tags without u., which + // is wrong, but we still want to display them + tagName = QString::fromStdString(tag.substr(2)); + + if (tagName.isEmpty()) + continue; + + auto tagAction = menu_->addAction(tagName); + tagAction->setCheckable(true); + tagAction->setWhatsThis(tr("Adds or removes the specified tag.", + "WhatsThis hint for tag menu actions")); + + for (const auto &riTag : roomInfo.tags) + if (riTag == tag) { + tagAction->setChecked(true); + break; + } + + connect(tagAction, &QAction::triggered, this, [this, tag](bool checked) { + if (checked) + http::client()->put_tag( + roomId_.toStdString(), + tag, + {}, + [tag](mtx::http::RequestErr err) { + if (err) { + nhlog::ui()->error( + "Failed to add tag: {}, {}", + tag, + err->matrix_error.error); + } + }); + else + http::client()->delete_tag( + roomId_.toStdString(), + tag, + [tag](mtx::http::RequestErr err) { + if (err) { + nhlog::ui()->error( + "Failed to delete tag: {}, {}", + tag, + err->matrix_error.error); + } + }); + }); + } + + auto newTagAction = menu_->addAction(tr("New tag...", "Add a new tag to the room")); + connect(newTagAction, &QAction::triggered, this, [this]() { + QString tagName = + QInputDialog::getText(this, + tr("New Tag", "Tag name prompt title"), + tr("Tag:", "Tag name prompt")); + if (tagName.isEmpty()) + return; + + std::string tag = "u." + tagName.toStdString(); + + http::client()->put_tag( + roomId_.toStdString(), tag, {}, [tag](mtx::http::RequestErr err) { + if (err) { + nhlog::ui()->error("Failed to add tag: {}, {}", + tag, + err->matrix_error.error); + } + }); + }); + }); } RoomInfoListItem::RoomInfoListItem(QString room_id, |