mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
fix call history popup add/see friend
This commit is contained in:
parent
0dcecdd578
commit
ea1dd96006
6 changed files with 18 additions and 17 deletions
|
|
@ -92,6 +92,7 @@ FriendCore::FriendCore(const std::shared_ptr<linphone::Friend> &contact, bool is
|
|||
mIsStored = isStored;
|
||||
mIsLdap = ToolModel::friendIsInFriendList(ToolModel::getLdapFriendList(), contact);
|
||||
mIsCardDAV = (sourceFlags & (int)linphone::MagicSearch::Source::RemoteCardDAV) != 0;
|
||||
mIsAppFriend = ToolModel::friendIsInFriendList(ToolModel::getAppFriendList(), contact);
|
||||
} else {
|
||||
mIsSaved = false;
|
||||
mStarred = false;
|
||||
|
|
@ -119,6 +120,7 @@ FriendCore::FriendCore(const FriendCore &friendCore) {
|
|||
mIsSaved = friendCore.mIsSaved;
|
||||
mIsStored = friendCore.mIsStored;
|
||||
mIsLdap = friendCore.mIsLdap;
|
||||
mIsAppFriend = friendCore.mIsAppFriend;
|
||||
mIsCardDAV = friendCore.mIsCardDAV;
|
||||
}
|
||||
|
||||
|
|
@ -743,6 +745,10 @@ bool FriendCore::isCardDAV() const {
|
|||
return mIsCardDAV;
|
||||
}
|
||||
|
||||
bool FriendCore::isAppFriend() const {
|
||||
return mIsAppFriend;
|
||||
}
|
||||
|
||||
bool FriendCore::getReadOnly() const {
|
||||
return isLdap() || isCardDAV(); // TODO add conditions for friends retrieved via HTTP
|
||||
// [misc]vcards-contacts-list=<URL> & CardDAV
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ class FriendCore : public QObject, public AbstractObject {
|
|||
Q_PROPERTY(bool starred READ getStarred WRITE lSetStarred NOTIFY starredChanged)
|
||||
Q_PROPERTY(bool readOnly READ getReadOnly CONSTANT)
|
||||
Q_PROPERTY(bool isLdap READ isLdap CONSTANT)
|
||||
Q_PROPERTY(bool isAppFriend READ isAppFriend CONSTANT)
|
||||
Q_PROPERTY(bool isCardDAV READ isCardDAV CONSTANT)
|
||||
|
||||
public:
|
||||
|
|
@ -148,6 +149,7 @@ public:
|
|||
void onPresenceReceived(LinphoneEnums::ConsolidatedPresence consolidatedPresence, QDateTime presenceTimestamp);
|
||||
|
||||
bool isLdap() const;
|
||||
bool isAppFriend() const;
|
||||
bool isCardDAV() const;
|
||||
bool getReadOnly() const;
|
||||
|
||||
|
|
@ -207,7 +209,7 @@ protected:
|
|||
bool mIsSaved;
|
||||
bool mIsStored;
|
||||
QString mVCardString;
|
||||
bool mIsLdap, mIsCardDAV;
|
||||
bool mIsLdap, mIsCardDAV, mIsAppFriend;
|
||||
std::shared_ptr<FriendModel> mFriendModel;
|
||||
QSharedPointer<SafeConnection<FriendCore, FriendModel>> mFriendModelConnection;
|
||||
QSharedPointer<SafeConnection<FriendCore, CoreModel>> mCoreModelConnection;
|
||||
|
|
|
|||
|
|
@ -1000,7 +1000,7 @@
|
|||
<location filename="../../view/Page/Main/Call/CallPage.qml" line="532"/>
|
||||
<source>menu_see_existing_contact</source>
|
||||
<extracomment>"Voir le contact"</extracomment>
|
||||
<translation>See contact</translation>
|
||||
<translation>Show contact</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Main/Call/CallPage.qml" line="534"/>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
|
||||
#include "FriendsManager.hpp"
|
||||
|
||||
#include "model/core/CoreModel.hpp"
|
||||
#include "tool/Utils.hpp"
|
||||
#include <QDebug>
|
||||
|
|
|
|||
|
|
@ -130,10 +130,10 @@ std::shared_ptr<linphone::Friend> ToolModel::findFriendByAddress(std::shared_ptr
|
|||
auto friendsManager = FriendsManager::getInstance();
|
||||
QString key = Utils::coreStringToAppString(linphoneAddr->asStringUriOnly());
|
||||
if (friendsManager->isInKnownFriends(key)) {
|
||||
// qDebug() << "Friend have been found in known friend, return it";
|
||||
// qDebug() << key << "have been found in known friend, return it";
|
||||
return friendsManager->getKnownFriendAtKey(key);
|
||||
} else if (friendsManager->isInUnknownFriends(key)) {
|
||||
// qDebug() << "Friend have been found in unknown friend, return it";
|
||||
// qDebug() << key << "have been found in unknown friend, return it";
|
||||
return friendsManager->getUnknownFriendAtKey(key);
|
||||
}
|
||||
auto f = CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
||||
|
|
|
|||
|
|
@ -496,12 +496,11 @@ AbstractMainPage {
|
|||
visible: mainItem.selectedRowHistoryGui != undefined
|
||||
callHistoryGui: selectedRowHistoryGui
|
||||
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(
|
||||
specificAddress)
|
||||
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(specificAddress)
|
||||
contact: contactObj && contactObj.value || null
|
||||
specificAddress: callHistoryGui
|
||||
&& callHistoryGui.core.remoteAddress || ""
|
||||
property bool isLocalFriend: contact ? contact.core.isAppFriend : false
|
||||
|
||||
buttonContent: PopupButton {
|
||||
id: detailOptions
|
||||
|
|
@ -523,21 +522,16 @@ AbstractMainPage {
|
|||
anchors.fill: parent
|
||||
IconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
property bool isLdap: contactDetail.contact?.core?.isLdap
|
||||
|| false
|
||||
property bool isCardDAV: contactDetail.contact?.core?.isCardDAV
|
||||
|| false
|
||||
property bool isLocalFriend: contactDetail.contact && !isLdap && !isCardDAV
|
||||
//: "Voir le contact"
|
||||
text: isLocalFriend ? qsTr("menu_see_existing_contact") :
|
||||
//: "Ajouter aux contacts"
|
||||
//: "Show contact"
|
||||
text: contactDetail.isLocalFriend ? qsTr("menu_see_existing_contact") :
|
||||
//: "Add to contacts"
|
||||
qsTr("menu_add_address_to_contacts")
|
||||
icon.source: AppIcons.plusCircle
|
||||
icon.width: Math.round(32 * DefaultStyle.dp)
|
||||
icon.height: Math.round(32 * DefaultStyle.dp)
|
||||
onClicked: {
|
||||
detailOptions.close()
|
||||
if (isLocalFriend)
|
||||
if (contactDetail.isLocalFriend)
|
||||
mainWindow.displayContactPage(
|
||||
contactDetail.contactAddress)
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue