Add a way to add private notes for users on their profile

This is a common feature in other chat applications (like Discord) as a
way to keep track of important information. While there isn't a standard
API for this, we can use account data to store notes.
This commit is contained in:
Joshua Goins
2026-01-07 15:48:33 -05:00
parent 6001cc6d4f
commit 7119132e4b
3 changed files with 56 additions and 0 deletions

View File

@@ -401,5 +401,34 @@ Kirigami.Dialog {
color: Kirigami.Theme.disabledTextColor
}
}
Kirigami.Heading {
text: i18nc("@title Private note for this user", "Private Note")
level: 4
Layout.topMargin: Kirigami.Units.largeSpacing
}
QQC2.TextArea {
id: noteText
text: root.connection.noteForUser(root.user.id)
textFormat: TextEdit.PlainText
wrapMode: TextEdit.Wrap
placeholderText: i18nc("@info:placeholder", "Only visible to you")
onTextEdited: editTimer.restart()
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.smallSpacing
// Prevent unnecessary edits by waiting 1 second
Timer {
id: editTimer
interval: 1000
onTriggered: root.connection.setNoteForUser(root.user.id, noteText.text)
}
}
}
}