Bring back room subtitles
Show last appropriate room message/event as subtitle
This commit is contained in:
@@ -2,7 +2,7 @@ import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.4
|
||||
import "../base" as Base
|
||||
import "get_event_text.js" as GetEventTextJS
|
||||
import "utils.js" as ChatJS
|
||||
|
||||
Row {
|
||||
id: row
|
||||
@@ -11,9 +11,7 @@ Row {
|
||||
anchors.right: isOwn ? parent.right : undefined
|
||||
|
||||
readonly property string contentText:
|
||||
(isMessage || isUndecryptableEvent) ?
|
||||
"" :
|
||||
GetEventTextJS.get_event_text(type, dict)
|
||||
isMessage ? "" : ChatJS.get_event_text(type, dict)
|
||||
|
||||
Base.Avatar {
|
||||
id: avatar
|
||||
@@ -24,7 +22,8 @@ Row {
|
||||
|
||||
Base.HLabel {
|
||||
id: contentLabel
|
||||
text: "<font color=gray>" +
|
||||
text: "<font color='" +
|
||||
(isUndecryptableEvent ? "darkred" : "gray") + "'>" +
|
||||
displayName + " " + contentText +
|
||||
" <font size=" + smallSize + "px>" +
|
||||
Qt.formatDateTime(date_time, "hh:mm:ss") +
|
||||
|
@@ -38,9 +38,7 @@ Row {
|
||||
//"</font>" +
|
||||
// (isOwn ? " " + content : "")
|
||||
|
||||
text: (isUndecryptableEvent ?
|
||||
"<font color=darkred>Missing decryption keys for this message.</font>" :
|
||||
dict.formatted_body || dict.body) +
|
||||
text: (dict.formatted_body || dict.body) +
|
||||
" <font size=" + smallSize + "px color=gray>" +
|
||||
Qt.formatDateTime(date_time, "hh:mm:ss") +
|
||||
"</font>"
|
||||
|
@@ -55,7 +55,7 @@ Column {
|
||||
|
||||
Daybreak { visible: dayBreak }
|
||||
|
||||
MessageContent { visible: isMessage || isUndecryptableEvent }
|
||||
MessageContent { visible: isMessage }
|
||||
|
||||
EventContent { visible: ! (isMessage || isUndecryptableEvent) }
|
||||
EventContent { visible: ! isMessage }
|
||||
}
|
||||
|
@@ -45,6 +45,10 @@ function get_event_text(type, dict) {
|
||||
return "turned on encryption for this room."
|
||||
break
|
||||
|
||||
case "OlmEvent":
|
||||
case "MegolmEvent":
|
||||
return "hasn't sent your device the keys to decrypt this message."
|
||||
|
||||
default:
|
||||
console.log(type + "\n" + JSON.stringify(dict, null, 4) + "\n")
|
||||
return "did something this client does not understand."
|
Reference in New Issue
Block a user