mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2025-12-18 08:35:26 +08:00
callmessagedelegate: connect to call status
This patch makes sure instances are updated on call status update Change-Id: I723603cb5f679534daf4af1ed327a0185dca2b0b
This commit is contained in:
@@ -27,6 +27,12 @@ SBSMessageBase {
|
|||||||
|
|
||||||
property var confId: ConfId
|
property var confId: ConfId
|
||||||
property string currentCallId: CurrentCall.id
|
property string currentCallId: CurrentCall.id
|
||||||
|
property bool isRemoteImage
|
||||||
|
property color baseColor: JamiTheme.messageInBgColor
|
||||||
|
property bool isActive: LRCInstance.indexOfActiveCall(root.confId, ActionUri, DeviceId) !== -1
|
||||||
|
|
||||||
|
visible: isActive || root.confId === "" || Duration > 0
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
|
|
||||||
isOutgoing: Author === CurrentAccount.uri
|
isOutgoing: Author === CurrentAccount.uri
|
||||||
author: Author
|
author: Author
|
||||||
@@ -47,16 +53,17 @@ SBSMessageBase {
|
|||||||
}).join(", ") : "");
|
}).join(", ") : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool isRemoteImage
|
|
||||||
property color baseColor: JamiTheme.messageInBgColor
|
|
||||||
property bool isActive: LRCInstance.indexOfActiveCall(root.confId, ActionUri, DeviceId) !== -1
|
|
||||||
|
|
||||||
bubble.border.color: CurrentConversation.color
|
bubble.border.color: CurrentConversation.color
|
||||||
bubble.border.width: 0
|
bubble.border.width: 0
|
||||||
bubble.color: JamiTheme.messageInBgColor
|
bubble.color: JamiTheme.messageInBgColor
|
||||||
bubble.opacity: 1
|
bubble.opacity: 1
|
||||||
|
|
||||||
visible: isActive || root.confId === "" || Duration > 0
|
Connections {
|
||||||
|
target: CurrentConversation
|
||||||
|
function onActiveCallsChanged() {
|
||||||
|
root.isActive = LRCInstance.indexOfActiveCall(root.confId, ActionUri, DeviceId) !== -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
component JoinCallButton: PushButton {
|
component JoinCallButton: PushButton {
|
||||||
visible: root.isActive && root.currentCallId !== root.confId
|
visible: root.isActive && root.currentCallId !== root.confId
|
||||||
@@ -77,11 +84,12 @@ SBSMessageBase {
|
|||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: statusIcon
|
id: statusIcon
|
||||||
|
visible: !root.isActive
|
||||||
|
|
||||||
Layout.leftMargin: 8
|
Layout.leftMargin: 8
|
||||||
width: 10
|
width: 10
|
||||||
height: 10
|
height: 10
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
visible: !root.isActive
|
|
||||||
|
|
||||||
source: {
|
source: {
|
||||||
if (root.isOutgoing) {
|
if (root.isOutgoing) {
|
||||||
@@ -110,7 +118,7 @@ SBSMessageBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
visible: isActive
|
visible: root.isActive
|
||||||
text: JamiStrings.callStarted
|
text: JamiStrings.callStarted
|
||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
color: UtilsAdapter.luma(root.baseColor) ? JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorDark
|
color: UtilsAdapter.luma(root.baseColor) ? JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorDark
|
||||||
@@ -128,7 +136,7 @@ SBSMessageBase {
|
|||||||
|
|
||||||
Layout.leftMargin: root.isActive ? 10 : 5
|
Layout.leftMargin: root.isActive ? 10 : 5
|
||||||
|
|
||||||
text: isActive ? bubble.timestampItem.formattedTime : Body
|
text: root.isActive ? bubble.timestampItem.formattedTime : Body
|
||||||
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
@@ -143,6 +151,7 @@ SBSMessageBase {
|
|||||||
|
|
||||||
JoinCallButton {
|
JoinCallButton {
|
||||||
id: joinCallWithAudio
|
id: joinCallWithAudio
|
||||||
|
visible: root.isActive
|
||||||
Layout.topMargin: 0.5 // For better sub-pixel rendering
|
Layout.topMargin: 0.5 // For better sub-pixel rendering
|
||||||
objectName: "joinCallWithAudio"
|
objectName: "joinCallWithAudio"
|
||||||
source: JamiResources.place_audiocall_24dp_svg
|
source: JamiResources.place_audiocall_24dp_svg
|
||||||
|
|||||||
Reference in New Issue
Block a user