fix conferences info in call history
This commit is contained in:
parent
8ba61d800f
commit
552f7acb46
7 changed files with 53 additions and 20 deletions
|
|
@ -46,12 +46,21 @@ CallHistoryCore::CallHistoryCore(const std::shared_ptr<linphone::CallLog> &callL
|
||||||
|
|
||||||
auto addr = callLog->getRemoteAddress()->clone();
|
auto addr = callLog->getRemoteAddress()->clone();
|
||||||
addr->clean();
|
addr->clean();
|
||||||
mRemoteAddress = Utils::coreStringToAppString(addr->asStringUriOnly());
|
|
||||||
// mRemoteAddress->clean();
|
// mRemoteAddress->clean();
|
||||||
mStatus = LinphoneEnums::fromLinphone(callLog->getStatus());
|
mStatus = LinphoneEnums::fromLinphone(callLog->getStatus());
|
||||||
mDate = QDateTime::fromMSecsSinceEpoch(callLog->getStartDate() * 1000);
|
mDate = QDateTime::fromMSecsSinceEpoch(callLog->getStartDate() * 1000);
|
||||||
mIsOutgoing = callLog->getDir() == linphone::Call::Dir::Outgoing;
|
mIsOutgoing = callLog->getDir() == linphone::Call::Dir::Outgoing;
|
||||||
mDuration = QString::number(callLog->getDuration());
|
mDuration = QString::number(callLog->getDuration());
|
||||||
|
mIsConference = callLog->wasConference();
|
||||||
|
if (mIsConference) {
|
||||||
|
auto confinfo = callLog->getConferenceInfo();
|
||||||
|
confinfo->getSubject();
|
||||||
|
mRemoteAddress = Utils::coreStringToAppString(confinfo->getUri()->asStringUriOnly());
|
||||||
|
mDisplayName = Utils::coreStringToAppString(confinfo->getSubject());
|
||||||
|
} else {
|
||||||
|
mRemoteAddress = Utils::coreStringToAppString(addr->asStringUriOnly());
|
||||||
|
mDisplayName = ToolModel::getDisplayName(Utils::coreStringToAppString(addr->asStringUriOnly()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CallHistoryCore::~CallHistoryCore() {
|
CallHistoryCore::~CallHistoryCore() {
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,10 @@ class CallHistoryModel;
|
||||||
class CallHistoryCore : public QObject, public AbstractObject {
|
class CallHistoryCore : public QObject, public AbstractObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(QString displayName MEMBER mDisplayName CONSTANT)
|
||||||
Q_PROPERTY(QString remoteAddress MEMBER mRemoteAddress CONSTANT)
|
Q_PROPERTY(QString remoteAddress MEMBER mRemoteAddress CONSTANT)
|
||||||
Q_PROPERTY(bool isOutgoing MEMBER mIsOutgoing CONSTANT)
|
Q_PROPERTY(bool isOutgoing MEMBER mIsOutgoing CONSTANT)
|
||||||
|
Q_PROPERTY(bool isConference MEMBER mIsConference CONSTANT)
|
||||||
Q_PROPERTY(QDateTime date MEMBER mDate CONSTANT)
|
Q_PROPERTY(QDateTime date MEMBER mDate CONSTANT)
|
||||||
Q_PROPERTY(LinphoneEnums::CallStatus status MEMBER mStatus CONSTANT)
|
Q_PROPERTY(LinphoneEnums::CallStatus status MEMBER mStatus CONSTANT)
|
||||||
Q_PROPERTY(QString duration READ getDuration WRITE setDuration NOTIFY durationChanged)
|
Q_PROPERTY(QString duration READ getDuration WRITE setDuration NOTIFY durationChanged)
|
||||||
|
|
@ -52,8 +54,10 @@ public:
|
||||||
Q_INVOKABLE void remove();
|
Q_INVOKABLE void remove();
|
||||||
|
|
||||||
QString mRemoteAddress;
|
QString mRemoteAddress;
|
||||||
|
QString mDisplayName;
|
||||||
QDateTime mDate;
|
QDateTime mDate;
|
||||||
bool mIsOutgoing;
|
bool mIsOutgoing;
|
||||||
|
bool mIsConference;
|
||||||
LinphoneEnums::CallStatus mStatus;
|
LinphoneEnums::CallStatus mStatus;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include "core/call/CallGui.hpp"
|
#include "core/call/CallGui.hpp"
|
||||||
#include "core/conference/ConferenceInfoCore.hpp"
|
#include "core/conference/ConferenceInfoCore.hpp"
|
||||||
#include "core/conference/ConferenceInfoGui.hpp"
|
#include "core/conference/ConferenceInfoGui.hpp"
|
||||||
|
#include "core/friend/FriendGui.hpp"
|
||||||
#include "core/path/Paths.hpp"
|
#include "core/path/Paths.hpp"
|
||||||
#include "model/object/VariantObject.hpp"
|
#include "model/object/VariantObject.hpp"
|
||||||
#include "model/tool/ToolModel.hpp"
|
#include "model/tool/ToolModel.hpp"
|
||||||
|
|
@ -298,6 +299,22 @@ QString Utils::findAvatarByAddress(const QString &address) {
|
||||||
return avatar;
|
return avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VariantObject *Utils::findFriendByAddress(const QString &address) {
|
||||||
|
VariantObject *data = new VariantObject();
|
||||||
|
if (!data) return nullptr;
|
||||||
|
data->makeRequest([address]() {
|
||||||
|
auto defaultFriendList = CoreModel::getInstance()->getCore()->getDefaultFriendList();
|
||||||
|
if (!defaultFriendList) return QVariant();
|
||||||
|
auto linphoneAddr = ToolModel::interpretUrl(address);
|
||||||
|
auto linFriend = CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
||||||
|
if (!linFriend) return QVariant();
|
||||||
|
auto friendCore = FriendCore::create(linFriend);
|
||||||
|
return QVariant::fromValue(new FriendGui(friendCore));
|
||||||
|
});
|
||||||
|
data->requestValue();
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
QString Utils::generateSavedFilename(const QString &from, const QString &to) {
|
QString Utils::generateSavedFilename(const QString &from, const QString &to) {
|
||||||
auto escape = [](const QString &str) {
|
auto escape = [](const QString &str) {
|
||||||
constexpr char ReservedCharacters[] = "[<|>|:|\"|/|\\\\|\\?|\\*|\\+|\\||_|-]+";
|
constexpr char ReservedCharacters[] = "[<|>|:|\"|/|\\\\|\\?|\\*|\\+|\\||_|-]+";
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ public:
|
||||||
Q_INVOKABLE static QDateTime addYears(QDateTime date, int years);
|
Q_INVOKABLE static QDateTime addYears(QDateTime date, int years);
|
||||||
Q_INVOKABLE static QString generateLinphoneSipAddress(const QString &uri);
|
Q_INVOKABLE static QString generateLinphoneSipAddress(const QString &uri);
|
||||||
Q_INVOKABLE static QString findAvatarByAddress(const QString &address);
|
Q_INVOKABLE static QString findAvatarByAddress(const QString &address);
|
||||||
|
Q_INVOKABLE static VariantObject *findFriendByAddress(const QString &address);
|
||||||
static QString generateSavedFilename(const QString &from, const QString &to);
|
static QString generateSavedFilename(const QString &from, const QString &to);
|
||||||
Q_INVOKABLE static bool isMe(const QString &address);
|
Q_INVOKABLE static bool isMe(const QString &address);
|
||||||
Q_INVOKABLE static bool isLocal(const QString &address);
|
Q_INVOKABLE static bool isLocal(const QString &address);
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@ ColumnLayout {
|
||||||
property string contactAddress: contact && contact.core.defaultAddress || ""
|
property string contactAddress: contact && contact.core.defaultAddress || ""
|
||||||
property string contactName: contact && contact.core.displayName || ""
|
property string contactName: contact && contact.core.displayName || ""
|
||||||
|
|
||||||
property bool addressVisible: true
|
|
||||||
|
|
||||||
property alias buttonContent: rightButton.data
|
property alias buttonContent: rightButton.data
|
||||||
property alias detailContent: detailControl.data
|
property alias detailContent: detailControl.data
|
||||||
|
|
||||||
|
|
@ -50,7 +48,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.preferredWidth: mainItem.implicitWidth
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: detailAvatar.height
|
Layout.preferredHeight: detailAvatar.height
|
||||||
// Layout.fillWidth: true
|
// Layout.fillWidth: true
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
@ -73,11 +71,15 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
// Layout.fillWidth: true
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
Text {
|
Text {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.fillWidth: true
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
elide: Text.ElideRight
|
||||||
text: mainItem.contactName
|
text: mainItem.contactName
|
||||||
|
maximumLineCount: 1
|
||||||
font {
|
font {
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
weight: 400 * DefaultStyle.dp
|
weight: 400 * DefaultStyle.dp
|
||||||
|
|
@ -85,11 +87,10 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: contactAddress
|
|
||||||
property var mode : contact ? contact.core.consolidatedPresence : -1
|
property var mode : contact ? contact.core.consolidatedPresence : -1
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
visible: mainItem.addressVisible
|
visible: mainItem.contact
|
||||||
text: mode === LinphoneEnums.ConsolidatedPresence.Online
|
text: mode === LinphoneEnums.ConsolidatedPresence.Online
|
||||||
? qsTr("En ligne")
|
? qsTr("En ligne")
|
||||||
: mode === LinphoneEnums.ConsolidatedPresence.Busy
|
: mode === LinphoneEnums.ConsolidatedPresence.Busy
|
||||||
|
|
@ -126,8 +127,7 @@ ColumnLayout {
|
||||||
button.icon.source: AppIcons.phone
|
button.icon.source: AppIcons.phone
|
||||||
label: qsTr("Appel")
|
label: qsTr("Appel")
|
||||||
button.onClicked: {
|
button.onClicked: {
|
||||||
var addr = UtilsCpp.generateLinphoneSipAddress(mainItem.contactAddress)
|
UtilsCpp.createCall(mainItem.contactAddress)
|
||||||
UtilsCpp.createCall(addr)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LabelButton {
|
LabelButton {
|
||||||
|
|
@ -150,8 +150,7 @@ ColumnLayout {
|
||||||
button.icon.source: AppIcons.videoCamera
|
button.icon.source: AppIcons.videoCamera
|
||||||
label: qsTr("Appel Video")
|
label: qsTr("Appel Video")
|
||||||
button.onClicked: {
|
button.onClicked: {
|
||||||
var addr = UtilsCpp.generateLinphoneSipAddress(mainItem.contactAddress)
|
UtilsCpp.createCall(mainItem.contactAddress, {'localVideoEnabled':true})
|
||||||
UtilsCpp.createCall(addr, {'localVideoEnabled':true})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ AbstractMainPage {
|
||||||
else rightPanelStackView.replace(emptySelection, Control.StackView.Immediate)
|
else rightPanelStackView.replace(emptySelection, Control.StackView.Immediate)
|
||||||
}
|
}
|
||||||
rightPanelStackView.initialItem: emptySelection
|
rightPanelStackView.initialItem: emptySelection
|
||||||
|
rightPanelStackView.width: 360 * DefaultStyle.dp
|
||||||
|
|
||||||
onNoItemButtonPressed: goToNewCall()
|
onNoItemButtonPressed: goToNewCall()
|
||||||
|
|
||||||
|
|
@ -48,6 +49,10 @@ AbstractMainPage {
|
||||||
listStackView.push(newCallItem)
|
listStackView.push(newCallItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createCall(addr) {
|
||||||
|
UtilsCpp.createCall(addr)
|
||||||
|
}
|
||||||
|
|
||||||
Dialog {
|
Dialog {
|
||||||
id: deleteHistoryPopup
|
id: deleteHistoryPopup
|
||||||
width: 278 * DefaultStyle.dp
|
width: 278 * DefaultStyle.dp
|
||||||
|
|
@ -92,7 +97,7 @@ AbstractMainPage {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
onLaunchCall: {
|
onLaunchCall: {
|
||||||
UtilsCpp.createCall(searchBar.text + "@sip.linphone.org")
|
mainItem.createCall(UtilsCpp.generateLinphoneSipAddress(searchBar.text))
|
||||||
// TODO : auto completion instead of sip linphone
|
// TODO : auto completion instead of sip linphone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -248,8 +253,7 @@ AbstractMainPage {
|
||||||
id: friendAddress
|
id: friendAddress
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
property var remoteAddress: modelData ? UtilsCpp.getDisplayName(modelData.core.remoteAddress) : null
|
text: modelData.core.displayName
|
||||||
text: remoteAddress ? remoteAddress.value : ""
|
|
||||||
font {
|
font {
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
weight: 400 * DefaultStyle.dp
|
weight: 400 * DefaultStyle.dp
|
||||||
|
|
@ -311,8 +315,7 @@ AbstractMainPage {
|
||||||
icon.width: 24 * DefaultStyle.dp
|
icon.width: 24 * DefaultStyle.dp
|
||||||
icon.height: 24 * DefaultStyle.dp
|
icon.height: 24 * DefaultStyle.dp
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var addr = UtilsCpp.generateLinphoneSipAddress(modelData.core.remoteAddress)
|
mainItem.createCall(modelData.core.remoteAddress)
|
||||||
UtilsCpp.createCall(addr)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -405,7 +408,7 @@ AbstractMainPage {
|
||||||
searchBarColor: DefaultStyle.grey_100
|
searchBarColor: DefaultStyle.grey_100
|
||||||
|
|
||||||
onCallButtonPressed: (address) => {
|
onCallButtonPressed: (address) => {
|
||||||
UtilsCpp.createCall(UtilsCpp.generateLinphoneSipAddress(address))
|
mainItem.createCall(address)
|
||||||
// var window = UtilsCpp.getCallsWindow()
|
// var window = UtilsCpp.getCallsWindow()
|
||||||
}
|
}
|
||||||
onGroupCallCreationRequested: {
|
onGroupCallCreationRequested: {
|
||||||
|
|
@ -508,9 +511,10 @@ AbstractMainPage {
|
||||||
ContactLayout {
|
ContactLayout {
|
||||||
id: contactDetail
|
id: contactDetail
|
||||||
visible: mainItem.selectedRowHistoryGui != undefined
|
visible: mainItem.selectedRowHistoryGui != undefined
|
||||||
property var remoteName: mainItem.selectedRowHistoryGui ? UtilsCpp.getDisplayName(mainItem.selectedRowHistoryGui.core.remoteAddress) : null
|
property var contactObj: UtilsCpp.findFriendByAddress(contactAddress)
|
||||||
|
contact: contactObj ? contactObj.value : null
|
||||||
contactAddress: mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress || ""
|
contactAddress: mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress || ""
|
||||||
contactName: remoteName ? remoteName.value : ""
|
contactName: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.displayName : ""
|
||||||
anchors.top: rightPanelStackView.top
|
anchors.top: rightPanelStackView.top
|
||||||
anchors.bottom: rightPanelStackView.bottom
|
anchors.bottom: rightPanelStackView.bottom
|
||||||
anchors.topMargin: 45 * DefaultStyle.dp
|
anchors.topMargin: 45 * DefaultStyle.dp
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,6 @@ AbstractMainPage {
|
||||||
Control.ScrollView {
|
Control.ScrollView {
|
||||||
id: listLayout
|
id: listLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.topMargin: 25 * DefaultStyle.dp
|
|
||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: content.height
|
contentHeight: content.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue