Fix image delegate color && fix lastEvent.
This commit is contained in:
parent
104e194cfb
commit
0301590b44
|
@ -12,7 +12,7 @@ AvatarContainer {
|
||||||
width: messageImage.width + 24
|
width: messageImage.width + 24
|
||||||
height: messageImage.height + 24
|
height: messageImage.height + 24
|
||||||
|
|
||||||
color: sentByMe ? background : Material.accent
|
color: sentByMe ? background : Material.primary
|
||||||
|
|
||||||
DownloadableContent {
|
DownloadableContent {
|
||||||
id: downloadable
|
id: downloadable
|
||||||
|
|
|
@ -166,7 +166,7 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
text: (lastEvent || topic).replace(/(\r\n\t|\n|\r\t)/gm,"");
|
text: (lastEvent == "" ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm,"");
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
wrapMode: Text.NoWrap
|
wrapMode: Text.NoWrap
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ void MatriqueRoom::sendTypingNotification(bool isTyping) {
|
||||||
QString MatriqueRoom::lastEvent() {
|
QString MatriqueRoom::lastEvent() {
|
||||||
if (timelineSize() == 0) return "";
|
if (timelineSize() == 0) return "";
|
||||||
const RoomEvent* lastEvent = messageEvents().rbegin()->get();
|
const RoomEvent* lastEvent = messageEvents().rbegin()->get();
|
||||||
|
if (lastEvent->contentJson().value("body").toString() == "") return "";
|
||||||
return user(lastEvent->senderId())->displayname() + ": " +
|
return user(lastEvent->senderId())->displayname() + ": " +
|
||||||
lastEvent->contentJson().value("body").toString();
|
lastEvent->contentJson().value("body").toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue