Implement replying to event in backend

This commit is contained in:
miruka
2020-05-20 06:17:14 -04:00
parent aa8d3cf8d3
commit fb35a6ec14
7 changed files with 68 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ Item {
property bool ready: Boolean(userInfo && roomInfo)
property bool longLoading: false
property string replyToEventId: ""
property string replyToUserId: ""
property string replyToDisplayName: ""

View File

@@ -69,9 +69,11 @@ HColumnPage {
}
ReplyBar {
replyToEventId: chat.replyToEventId
replyToUserId: chat.replyToUserId
replyToDisplayName: chat.replyToDisplayName
onCancel: {
chat.replyToEventId = ""
chat.replyToUserId = ""
chat.replyToDisplayName = ""
}

View File

@@ -188,7 +188,7 @@ Rectangle {
if (textArea.text === "") { return }
const args = [chat.roomId, toSend]
const args = [chat.roomId, toSend, chat.replyToEventId]
py.callClientCoro(writingUserId, "send_text", args)
area.clear()

View File

@@ -9,7 +9,7 @@ InfoBar {
icon.svgName: "reply-to"
label.textFormat: Text.StyledText
label.text:
replyToUserId ?
replyToEventId ?
utils.coloredNameHtml(replyToDisplayName, replyToUserId) :
""
@@ -17,6 +17,7 @@ InfoBar {
signal cancel()
property string replyToEventId: ""
property string replyToUserId: ""
property string replyToDisplayName: ""
@@ -25,9 +26,6 @@ InfoBar {
backgroundColor: "transparent"
icon.name: "reply-cancel"
icon.color: theme.colors.negativeBackground
// iconItem.small: true
// topPadding: 0
// bottomPadding: topPadding
onClicked: cancel()
Layout.fillHeight: true

View File

@@ -233,6 +233,7 @@ HColumnLayout {
text: qsTr("Reply")
onTriggered: {
chat.replyToEventId = model.id
chat.replyToUserId = model.sender_id
chat.replyToDisplayName = model.sender_name
}