Call from chat room
This commit is contained in:
parent
ff78a5abf1
commit
f4e3db8a07
6 changed files with 63 additions and 35 deletions
|
|
@ -4500,6 +4500,11 @@ Pour les activer dans un projet commercial, merci de nous contacter.</source>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SelectedChatView</name>
|
<name>SelectedChatView</name>
|
||||||
|
<message>
|
||||||
|
<source>chat_view_group_call_toast_message</source>
|
||||||
|
<extracomment>"Start a group call ?"</extracomment>
|
||||||
|
<translation>Start a group call ?</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="229"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="229"/>
|
||||||
<source>chat_view_send_area_placeholder_text</source>
|
<source>chat_view_send_area_placeholder_text</source>
|
||||||
|
|
@ -6305,11 +6310,6 @@ Failed to create 1-1 conversation with %1 !</extracomment>
|
||||||
<extracomment>All the messages will be removed from the chat room. Do you want to continue ?</extracomment>
|
<extracomment>All the messages will be removed from the chat room. Do you want to continue ?</extracomment>
|
||||||
<translation>Alle Nachrichten werden aus dem Chat entfernt. Möchten Sie fortfahren?</translation>
|
<translation>Alle Nachrichten werden aus dem Chat entfernt. Möchten Sie fortfahren?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>group_infos_group_call_toast_message</source>
|
|
||||||
<extracomment>"Start a group call ?"</extracomment>
|
|
||||||
<translation>Start a group call ?</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GroupChatInfoParticipants</name>
|
<name>GroupChatInfoParticipants</name>
|
||||||
|
|
|
||||||
|
|
@ -4401,6 +4401,11 @@ To enable them in a commercial project, please contact us.</translation>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SelectedChatView</name>
|
<name>SelectedChatView</name>
|
||||||
|
<message>
|
||||||
|
<source>chat_view_group_call_toast_message</source>
|
||||||
|
<extracomment>"Start a group call ?"</extracomment>
|
||||||
|
<translation>Start a group call ?</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Dites quelque chose…</source>
|
<source>Dites quelque chose…</source>
|
||||||
<extracomment>Say something… : placeholder text for sending message text area</extracomment>
|
<extracomment>Say something… : placeholder text for sending message text area</extracomment>
|
||||||
|
|
@ -6314,11 +6319,6 @@ Failed to create 1-1 conversation with %1 !</extracomment>
|
||||||
<extracomment>All the messages will be removed from the chat room. Do you want to continue ?</extracomment>
|
<extracomment>All the messages will be removed from the chat room. Do you want to continue ?</extracomment>
|
||||||
<translation>All the messages will be removed from the chat room. Do you want to continue ?</translation>
|
<translation>All the messages will be removed from the chat room. Do you want to continue ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>group_infos_group_call_toast_message</source>
|
|
||||||
<extracomment>"Start a group call ?"</extracomment>
|
|
||||||
<translation>Start a group call ?</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GroupChatInfoParticipants</name>
|
<name>GroupChatInfoParticipants</name>
|
||||||
|
|
|
||||||
|
|
@ -4401,6 +4401,11 @@ Pour les activer dans un projet commercial, merci de nous contacter.</translatio
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SelectedChatView</name>
|
<name>SelectedChatView</name>
|
||||||
|
<message>
|
||||||
|
<source>chat_view_group_call_toast_message</source>
|
||||||
|
<extracomment>"Start a group call ?"</extracomment>
|
||||||
|
<translation>Démarrer un appel de groupe ?</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="229"/>
|
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="229"/>
|
||||||
<source>chat_view_send_area_placeholder_text</source>
|
<source>chat_view_send_area_placeholder_text</source>
|
||||||
|
|
@ -6211,11 +6216,6 @@ Failed to create 1-1 conversation with %1 !</extracomment>
|
||||||
<extracomment>All the messages will be removed from the chat room. Do you want to continue ?</extracomment>
|
<extracomment>All the messages will be removed from the chat room. Do you want to continue ?</extracomment>
|
||||||
<translation>Vous ne recevrez ni pourrez envoyer des messages dans cette conversation, quitter ?</translation>
|
<translation>Vous ne recevrez ni pourrez envoyer des messages dans cette conversation, quitter ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>group_infos_group_call_toast_message</source>
|
|
||||||
<extracomment>"Start a group call ?"</extracomment>
|
|
||||||
<translation>Démarrer un appel de groupe ?</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GroupChatInfoParticipants</name>
|
<name>GroupChatInfoParticipants</name>
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,40 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property ChatGui chat
|
property ChatGui chat
|
||||||
|
property var contactObj: chat ? UtilsCpp.findFriendByAddress(mainItem.chat.core.peerAddress) : null
|
||||||
|
property var contact: contactObj?.value || null
|
||||||
property CallGui call
|
property CallGui call
|
||||||
property alias callHeaderContent: splitPanel.headerContent
|
property alias callHeaderContent: splitPanel.headerContent
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
signal oneOneCall(bool video)
|
||||||
|
signal groupCall()
|
||||||
|
|
||||||
|
onOneOneCall: {
|
||||||
|
if (contact)
|
||||||
|
mainWindow.startCallWithContact(contact, video, mainItem)
|
||||||
|
else
|
||||||
|
UtilsCpp.createCall(mainItem.chat?.core.peerAddress, {'localVideoEnabled':video})
|
||||||
|
}
|
||||||
|
|
||||||
|
onGroupCall: {
|
||||||
|
mainWindow.showConfirmationLambdaPopup(qsTr(""),
|
||||||
|
qsTr("chat_view_group_call_toast_message"),
|
||||||
|
"",
|
||||||
|
function(confirmed) {
|
||||||
|
if (confirmed) {
|
||||||
|
const sourceList = mainItem.chat?.core.participants
|
||||||
|
let addresses = [];
|
||||||
|
for (let i = 0; i < sourceList.length; ++i) {
|
||||||
|
const participantGui = sourceList[i]
|
||||||
|
const participantCore = participantGui.core
|
||||||
|
addresses.push(participantCore.sipAddress)
|
||||||
|
}
|
||||||
|
UtilsCpp.createGroupCall(mainItem.chat?.core.title, addresses)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
//onEventChanged: {
|
//onEventChanged: {
|
||||||
// TODO : call when all messages read after scroll to unread feature available
|
// TODO : call when all messages read after scroll to unread feature available
|
||||||
// if (chat) chat.core.lMarkAsRead()
|
// if (chat) chat.core.lMarkAsRead()
|
||||||
|
|
@ -59,10 +89,19 @@ RowLayout {
|
||||||
BigButton {
|
BigButton {
|
||||||
style: ButtonStyle.noBackground
|
style: ButtonStyle.noBackground
|
||||||
icon.source: AppIcons.phone
|
icon.source: AppIcons.phone
|
||||||
|
onPressed: {
|
||||||
|
if (mainItem.chat.core.isGroupChat) {
|
||||||
|
mainItem.groupCall()
|
||||||
|
} else {
|
||||||
|
mainItem.oneOneCall(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BigButton {
|
BigButton {
|
||||||
style: ButtonStyle.noBackground
|
style: ButtonStyle.noBackground
|
||||||
icon.source: AppIcons.videoCamera
|
icon.source: AppIcons.videoCamera
|
||||||
|
visible: !mainItem.chat.core.isGroupChat
|
||||||
|
onPressed: mainItem.oneOneCall(true)
|
||||||
}
|
}
|
||||||
BigButton {
|
BigButton {
|
||||||
style: ButtonStyle.noBackground
|
style: ButtonStyle.noBackground
|
||||||
|
|
@ -269,6 +308,11 @@ RowLayout {
|
||||||
anchors.topMargin: Math.round(39 * DefaultStyle.dp)
|
anchors.topMargin: Math.round(39 * DefaultStyle.dp)
|
||||||
sourceComponent: mainItem.chat.core.isGroupChat ? groupInfoComponent : oneToOneInfoComponent
|
sourceComponent: mainItem.chat.core.isGroupChat ? groupInfoComponent : oneToOneInfoComponent
|
||||||
active: detailsPanel.visible
|
active: detailsPanel.visible
|
||||||
|
onLoaded: {
|
||||||
|
if (contentLoader.item) {
|
||||||
|
contentLoader.item.parentView = mainItem
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ ColumnLayout {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property ChatGui chatGui
|
property ChatGui chatGui
|
||||||
property var chatCore: chatGui.core
|
property var chatCore: chatGui.core
|
||||||
|
property var parentView
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Avatar {
|
Avatar {
|
||||||
|
|
@ -126,23 +127,7 @@ ColumnLayout {
|
||||||
button.icon.source: AppIcons.phone
|
button.icon.source: AppIcons.phone
|
||||||
//: "Appel"
|
//: "Appel"
|
||||||
label: qsTr("group_infos_call")
|
label: qsTr("group_infos_call")
|
||||||
button.onClicked: {
|
button.onClicked: parentView.groupCall()
|
||||||
mainWindow.showConfirmationLambdaPopup(qsTr("group_infos_call"),
|
|
||||||
qsTr("group_infos_group_call_toast_message"),
|
|
||||||
"",
|
|
||||||
function(confirmed) {
|
|
||||||
if (confirmed) {
|
|
||||||
const sourceList = mainItem.chatCore.participants
|
|
||||||
let addresses = [];
|
|
||||||
for (let i = 0; i < sourceList.length; ++i) {
|
|
||||||
const participantGui = sourceList[i]
|
|
||||||
const participantCore = participantGui.core
|
|
||||||
addresses.push(participantCore.sipAddress)
|
|
||||||
}
|
|
||||||
UtilsCpp.createGroupCall(mainItem.chatCore.title, addresses)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
LabelButton {
|
LabelButton {
|
||||||
width: Math.round(56 * DefaultStyle.dp)
|
width: Math.round(56 * DefaultStyle.dp)
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ ColumnLayout {
|
||||||
property ChatGui chatGui
|
property ChatGui chatGui
|
||||||
property var chatCore: chatGui.core
|
property var chatCore: chatGui.core
|
||||||
property var contactObj: chat ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null
|
property var contactObj: chat ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null
|
||||||
|
property var parentView
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Avatar {
|
Avatar {
|
||||||
|
|
@ -61,9 +62,7 @@ ColumnLayout {
|
||||||
button.icon.source: AppIcons.phone
|
button.icon.source: AppIcons.phone
|
||||||
//: "Appel"
|
//: "Appel"
|
||||||
label: qsTr("one_one_infos_call")
|
label: qsTr("one_one_infos_call")
|
||||||
button.onClicked: {
|
button.onClicked: parentView.oneOneCall(false)
|
||||||
mainWindow.startCallWithContact(contactObj.value, false, mainItem)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
LabelButton {
|
LabelButton {
|
||||||
width: Math.round(56 * DefaultStyle.dp)
|
width: Math.round(56 * DefaultStyle.dp)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue