Compare commits
5 Commits
fix-editin
...
work/redst
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b1b21dd07 | ||
|
|
85a562d469 | ||
|
|
f50c62ba12 | ||
|
|
13f05a0995 | ||
|
|
1adddcc0d9 |
@@ -1,13 +1,13 @@
|
||||
# Copyright (C) YEAR This file is copyright:
|
||||
# This file is distributed under the same license as the neochat package.
|
||||
# Vit Pelcak <vit@pelcak.org>, 2021, 2022.
|
||||
# Vit Pelcak <vit@pelcak.org>, 2021, 2022, 2023.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: neochat\n"
|
||||
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
|
||||
"POT-Creation-Date: 2023-01-04 00:48+0000\n"
|
||||
"PO-Revision-Date: 2022-02-11 15:44+0100\n"
|
||||
"PO-Revision-Date: 2023-01-04 10:14+0100\n"
|
||||
"Last-Translator: Vit Pelcak <vit@pelcak.org>\n"
|
||||
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
|
||||
"Language: cs\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
||||
"X-Generator: Lokalize 21.12.2\n"
|
||||
"X-Generator: Lokalize 22.12.0\n"
|
||||
|
||||
#: src/actionsmodel.cpp:30 src/actionsmodel.cpp:40 src/actionsmodel.cpp:50
|
||||
#: src/actionsmodel.cpp:60 src/actionsmodel.cpp:80 src/actionsmodel.cpp:100
|
||||
@@ -1830,7 +1830,7 @@ msgstr "Označit jako přečtený"
|
||||
#, kde-format
|
||||
msgctxt "@action:inmenu"
|
||||
msgid "Copy Address to Clipboard"
|
||||
msgstr ""
|
||||
msgstr "Kopírovat adresu do schránky"
|
||||
|
||||
#: src/qml/Menu/RoomListContextMenu.qml:65
|
||||
#, kde-format
|
||||
|
||||
@@ -14,7 +14,7 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Lokalize 21.12.3\n"
|
||||
|
||||
#: src/actionsmodel.cpp:30 src/actionsmodel.cpp:40 src/actionsmodel.cpp:50
|
||||
|
||||
@@ -2393,10 +2393,9 @@ msgid "No Topic"
|
||||
msgstr "Sem Tópico"
|
||||
|
||||
#: src/qml/Panel/RoomDrawer.qml:171
|
||||
#, fuzzy, kde-format
|
||||
#| msgid "Options:"
|
||||
#, kde-format
|
||||
msgid "Options"
|
||||
msgstr "Opções:"
|
||||
msgstr "Opções"
|
||||
|
||||
#: src/qml/Panel/RoomDrawer.qml:179
|
||||
#, kde-format
|
||||
|
||||
@@ -16,8 +16,8 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100>=3 && n"
|
||||
"%100<=4 ? 2 : 3);\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
|
||||
"%100==4 ? 3 : 0);\n"
|
||||
"X-Generator: Poedit 3.2.2\n"
|
||||
|
||||
#: src/actionsmodel.cpp:30 src/actionsmodel.cpp:40 src/actionsmodel.cpp:50
|
||||
|
||||
@@ -159,7 +159,7 @@ if(ANDROID)
|
||||
"zoom-out"
|
||||
"image-rotate-left-symbolic"
|
||||
"image-rotate-right-symbolic"
|
||||
"channel-insecure-symbolic"
|
||||
"channel-secure-symbolic"
|
||||
"download"
|
||||
"smiley"
|
||||
"tools-check-spelling"
|
||||
|
||||
@@ -52,8 +52,8 @@ QString Clipboard::saveImage(QString localPath) const
|
||||
}
|
||||
|
||||
QDir dir;
|
||||
if (!dir.exists(localPath)) {
|
||||
dir.mkpath(localPath);
|
||||
if (!dir.exists(QFileInfo(url.fileName()).absoluteFilePath())) {
|
||||
dir.mkpath(QFileInfo(url.fileName()).absoluteFilePath());
|
||||
}
|
||||
|
||||
image.save(url.toLocalFile());
|
||||
|
||||
@@ -937,24 +937,12 @@ QVariant MessageEventModel::getLastLocalUserMessageEventId()
|
||||
if (content.contains("m.new_content")) {
|
||||
// The message has been edited so we have to return the id of the original message instead of the replacement
|
||||
eventId = content["m.relates_to"].toObject()["event_id"].toString();
|
||||
e = eventCast<const RoomMessageEvent>(m_currentRoom->findInTimeline(eventId)->event());
|
||||
if (!e) {
|
||||
return {};
|
||||
}
|
||||
|
||||
content = e->contentJson();
|
||||
} else {
|
||||
// For any message that isn't an edit return the id of the current message
|
||||
eventId = (*it)->id();
|
||||
}
|
||||
targetMessage.insert("event_id", eventId);
|
||||
targetMessage.insert("formattedBody", content["formatted_body"].toString());
|
||||
|
||||
// keep reply relationship
|
||||
if (content.contains("m.relates_to")) {
|
||||
targetMessage.insert("m.relates_to", content["m.relates_to"].toObject());
|
||||
}
|
||||
|
||||
// Need to get the message from the original eventId or body will have * on the front
|
||||
QModelIndex idx = index(eventIDToIndex(eventId), 0);
|
||||
targetMessage.insert("message", idx.data(Qt::UserRole + 2));
|
||||
|
||||
@@ -739,25 +739,13 @@ void NeoChatRoom::postHtmlMessage(const QString &text, const QString &html, Mess
|
||||
}
|
||||
|
||||
if (isEdit) {
|
||||
QJsonObject content{{"body", text}, {"msgtype", msgTypeToString(type)}, {"format", "org.matrix.custom.html"}, {"formatted_body", html}};
|
||||
if (isReply) {
|
||||
content["m.relates_to"] =
|
||||
QJsonObject {
|
||||
{"m.in_reply_to",
|
||||
QJsonObject {
|
||||
{"event_id", replyEventId}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
QJsonObject json{
|
||||
{"type", "m.room.message"},
|
||||
{"msgtype", msgTypeToString(type)},
|
||||
{"body", "* " + text},
|
||||
{"format", "org.matrix.custom.html"},
|
||||
{"formatted_body", html},
|
||||
{"m.new_content", content},
|
||||
{"m.new_content", QJsonObject{{"body", text}, {"msgtype", msgTypeToString(type)}, {"format", "org.matrix.custom.html"}, {"formatted_body", html}}},
|
||||
{"m.relates_to", QJsonObject{{"rel_type", "m.replace"}, {"event_id", relateToEventId}}}};
|
||||
|
||||
postJson("m.room.message", json);
|
||||
|
||||
@@ -85,6 +85,7 @@ QQC2.ToolBar {
|
||||
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.SpellChecking.enabled: true
|
||||
|
||||
color: Kirigami.Theme.textColor
|
||||
selectionColor: Kirigami.Theme.highlightColor
|
||||
@@ -129,9 +130,6 @@ QQC2.ToolBar {
|
||||
} else if (event.key === Qt.Key_Up && inputField.text.length === 0) {
|
||||
let editEvent = messageEventModel.getLastLocalUserMessageEventId()
|
||||
if (editEvent) {
|
||||
if(editEvent["m.relates_to"]) {
|
||||
currentRoom.chatBoxReplyId = editEvent["m.relates_to"]["m.in_reply_to"]["event_id"];
|
||||
}
|
||||
currentRoom.chatBoxEditId = editEvent["event_id"]
|
||||
}
|
||||
} else if (event.key === Qt.Key_Up && completionMenu.visible) {
|
||||
|
||||
@@ -15,7 +15,6 @@ Loader {
|
||||
required property var author
|
||||
required property string message
|
||||
required property string eventId
|
||||
property string replyEventId
|
||||
property var eventType
|
||||
property string formattedBody: ""
|
||||
required property string source
|
||||
@@ -30,7 +29,7 @@ Loader {
|
||||
icon.name: "document-edit"
|
||||
onTriggered: {
|
||||
currentRoom.chatBoxEditId = eventId;
|
||||
currentRoom.chatBoxReplyId = replyEventId;
|
||||
currentRoom.chatBoxReplyId = "";
|
||||
}
|
||||
visible: author.id === Controller.activeConnection.localUserId && (loadRoot.eventType === MessageEventModel.Emote || loadRoot.eventType === MessageEventModel.Message)
|
||||
},
|
||||
|
||||
@@ -537,7 +537,7 @@ Kirigami.ScrollablePage {
|
||||
icon.name: "document-edit"
|
||||
onClicked: {
|
||||
currentRoom.chatBoxEditId = hoverActions.event.eventId;
|
||||
currentRoom.chatBoxReplyId = hoverActions.event.replyId;
|
||||
currentRoom.chatBoxReplyId = "";
|
||||
chatBox.focusInputField();
|
||||
}
|
||||
}
|
||||
@@ -682,7 +682,6 @@ Kirigami.ScrollablePage {
|
||||
author: event.author,
|
||||
message: event.display,
|
||||
eventId: event.eventId,
|
||||
replyEventId: event.replyId,
|
||||
formattedBody: event.formattedBody,
|
||||
source: event.source,
|
||||
eventType: event.eventType,
|
||||
|
||||
@@ -117,6 +117,23 @@ Kirigami.OverlayDrawer {
|
||||
|
||||
name: room ? room.displayName : ""
|
||||
source: room ? ("image://mxc/" + room.avatarMediaId) : ""
|
||||
|
||||
Rectangle {
|
||||
visible: room.usesEncryption
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
|
||||
width: Kirigami.Units.gridUnit
|
||||
height: Kirigami.Units.gridUnit
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
|
||||
radius: width / 2
|
||||
|
||||
Kirigami.Icon {
|
||||
source: "channel-secure-symbolic"
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
@@ -198,18 +215,6 @@ Kirigami.OverlayDrawer {
|
||||
})
|
||||
}
|
||||
}
|
||||
Kirigami.BasicListItem {
|
||||
id: inviteButton
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
icon: "list-add-user"
|
||||
text: i18n("Invite user to room")
|
||||
|
||||
onClicked: {
|
||||
applicationWindow().pageStack.layers.push("qrc:/InviteUserPage.qml", {room: room})
|
||||
roomDrawer.close();
|
||||
}
|
||||
}
|
||||
Kirigami.BasicListItem {
|
||||
id: favouriteButton
|
||||
|
||||
@@ -218,24 +223,34 @@ Kirigami.OverlayDrawer {
|
||||
|
||||
onClicked: room.isFavourite ? room.removeTag("m.favourite") : room.addTag("m.favourite", 1.0)
|
||||
}
|
||||
Kirigami.BasicListItem {
|
||||
id: encryptButton
|
||||
|
||||
icon: "channel-insecure-symbolic"
|
||||
enabled: roomDrawer.room.canEncryptRoom
|
||||
visible: !roomDrawer.room.usesEncryption && Controller.encryptionSupported
|
||||
text: i18n("Enable encryption")
|
||||
|
||||
onClicked: {
|
||||
let dialog = confirmEncryptionDialog.createObject(applicationWindow(), {room: roomDrawer.room});
|
||||
roomDrawer.close();
|
||||
dialog.open();
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.ListSectionHeader {
|
||||
label: i18n("Members")
|
||||
activeFocusOnTab: false
|
||||
spacing: 0
|
||||
|
||||
QQC2.ToolButton {
|
||||
id: memberSearchToggle
|
||||
checkable: true
|
||||
icon.name: "search"
|
||||
QQC2.ToolTip.text: i18n("Search user in room")
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
QQC2.ToolButton {
|
||||
visible: roomDrawer.room.canSendState("invite")
|
||||
icon.name: "list-add-user"
|
||||
|
||||
onClicked: {
|
||||
applicationWindow().pageStack.layers.push("qrc:/InviteUserPage.qml", {room: roomDrawer.room})
|
||||
roomDrawer.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: i18n("Invite user to room")
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
QQC2.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
@@ -245,6 +260,7 @@ Kirigami.OverlayDrawer {
|
||||
|
||||
Kirigami.SearchField {
|
||||
id: userListSearchField
|
||||
visible: memberSearchToggle.checked
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Kirigami.Units.largeSpacing - 1
|
||||
@@ -350,10 +366,4 @@ Kirigami.OverlayDrawer {
|
||||
|
||||
UserDetailDialog {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: confirmEncryptionDialog
|
||||
|
||||
ConfirmEncryptionDialog {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,29 @@ Kirigami.ScrollablePage {
|
||||
rightPadding: 0
|
||||
|
||||
ColumnLayout {
|
||||
MobileForm.FormCard {
|
||||
visible: Controller.encryptionSupported
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.fillWidth: true
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
MobileForm.FormCardHeader {
|
||||
title: i18nc("@option:check", "Encryption")
|
||||
}
|
||||
MobileForm.FormSwitchDelegate {
|
||||
id: enableEncryptionSwitch
|
||||
text: i18n("Enable encryption")
|
||||
description: i18nc("option:check", "Once enabled, encryption cannot be disabled.")
|
||||
enabled: room.canEncryptRoom
|
||||
checked: room.usesEncryption
|
||||
onToggled: if (checked) {
|
||||
let dialog = confirmEncryptionDialog.createObject(applicationWindow(), {room: room});
|
||||
dialog.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.fillWidth: true
|
||||
@@ -132,5 +155,25 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: confirmEncryptionDialog
|
||||
|
||||
ConfirmEncryptionDialog {
|
||||
onClosed: {
|
||||
// At the point this is executed, the state in the room is not yet changed.
|
||||
// The value will be updated when room.onEncryption() emitted.
|
||||
// This is in case if user simply closed the dialog.
|
||||
enableEncryptionSwitch.checked = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: room
|
||||
onEncryption: {
|
||||
enableEncryptionSwitch.checked = room.usesEncryption
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user