Show subject in notifications when it is not about one-one

This commit is contained in:
Julien Wadel 2021-10-13 18:24:52 +02:00
parent 54c972e573
commit 5ff2e5af61
2 changed files with 10 additions and 5 deletions

View file

@ -22,6 +22,7 @@ Rectangle {
property bool displayUnreadMessageCount: false
property bool showContactAddress : true
property bool showAuxData : false
// A entry from `SipAddressesModel` or an `SipAddressObserver`.
property var entry
@ -114,9 +115,12 @@ Rectangle {
Layout.leftMargin: ContactStyle.spacing
sipAddress: (entry && item.showContactAddress
&& (entry.isOneToOne == undefined || entry.isOneToOne) && (entry.haveEncryption == undefined || !entry.haveEncryption)
? entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || ''
: '')
&& (item.showAuxData
? entry.auxDataToShow || ''
: (entry.isOneToOne == undefined || entry.isOneToOne) && (entry.haveEncryption == undefined || !entry.haveEncryption)
? entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || ''
: '')
) || ''
participants: entry && item.showContactAddress && sipAddress == '' && entry.isOneToOne && entry.participants ? entry.participants.addressesToString : ''
username: item.username
}

View file

@ -40,13 +40,14 @@ Notification {
property ChatRoomModel chatRoomModel : notification.timelineModel.getChatRoomModel()
//entry: notification.fullPeerAddress? SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress): notification.timelineModel.getChatRoomModel()
property var sipObserver: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress)
showAuxData: !chatRoomModel.isOneToOne
entry: ({
sipAddress: sipObserver.peerAddress,
contactModel: sipObserver.contact,
isOneToOne: chatRoomModel.isOneToOne,
haveEncryption: chatRoomModel.haveEncryption,
securityLevel: chatRoomModel.securityLevel
securityLevel: chatRoomModel.securityLevel,
auxDataToShow: '- ' + chatRoomModel.subject+' -'
})
}