mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix #LINQT-1835 security circle avatar
This commit is contained in:
parent
41618bbdaa
commit
3546287649
13 changed files with 36 additions and 3 deletions
|
|
@ -466,6 +466,25 @@ VariantObject *Utils::findFriendByAddress(const QString &address) {
|
|||
return data;
|
||||
}
|
||||
|
||||
VariantObject *Utils::getFriendSecurityLevel(const QString &address) {
|
||||
VariantObject *data = new VariantObject("getFriendAddressSecurityLevel");
|
||||
if (!data) return nullptr;
|
||||
data->makeRequest([address]() {
|
||||
auto defaultFriendList = ToolModel::getAppFriendList();
|
||||
if (!defaultFriendList) return QVariant();
|
||||
auto linphoneAddr = ToolModel::interpretUrl(address);
|
||||
auto linFriend = CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
||||
if (!linFriend) return QVariant();
|
||||
auto linAddr = ToolModel::interpretUrl(address);
|
||||
if (!linAddr) return QVariant();
|
||||
auto devices = linFriend->getDevicesForAddress(linphoneAddr);
|
||||
int verified = 0;
|
||||
return QVariant::fromValue(LinphoneEnums::fromLinphone(linFriend->getSecurityLevel()));
|
||||
});
|
||||
data->requestValue();
|
||||
return data;
|
||||
}
|
||||
|
||||
VariantObject *Utils::getFriendAddressSecurityLevel(const QString &address) {
|
||||
VariantObject *data = new VariantObject("getFriendAddressSecurityLevel");
|
||||
if (!data) return nullptr;
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ public:
|
|||
Q_INVOKABLE static VariantObject *findAvatarByAddress(const QString &address);
|
||||
Q_INVOKABLE static VariantObject *findFriendByAddress(const QString &address);
|
||||
Q_INVOKABLE static VariantObject *getFriendAddressSecurityLevel(const QString &address);
|
||||
Q_INVOKABLE static VariantObject *getFriendSecurityLevel(const QString &address);
|
||||
static QString generateSavedFilename(const QString &from, const QString &to);
|
||||
Q_INVOKABLE static VariantObject *isMe(const QString &address);
|
||||
Q_INVOKABLE static VariantObject *isLocal(const QString &address);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ ListView {
|
|||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
_address: modelData.core.remoteAddress
|
||||
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
isConference: modelData.core.isConference
|
||||
shadowEnabled: false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@ Loader{
|
|||
: computedAvatarUri.length != 0
|
||||
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
||||
property string computedAvatarUri: avatarObj ? avatarObj.value : ''
|
||||
|
||||
// To get the secured property for a friend using an address to find it,
|
||||
// override it as secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
property var friendSecurityLevelObj: UtilsCpp.getFriendSecurityLevel(_address)
|
||||
property var friendSecurityLevel: friendSecurityLevelObj ? securityLevelObj.value : LinphoneEnums.SecurityLevel.None
|
||||
|
||||
// To get the secured property for a specific address,
|
||||
// override it as secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ FocusScope {
|
|||
// Use directly previous initial
|
||||
property real itemsRightMargin: Math.round(39 * DefaultStyle.dp)
|
||||
|
||||
property string displayName: searchResultItem? searchResultItem.core.fullName : ""
|
||||
property string initial: displayName != "" ? displayName[0].toLocaleLowerCase(ConstantsCpp.DefaultLocale) : ''
|
||||
property var displayName: searchResultItem? searchResultItem.core.fullName : ""
|
||||
property var initial: displayName != "" ? displayName[0].toLocaleLowerCase(ConstantsCpp.DefaultLocale) : ''
|
||||
|
||||
signal clicked(var mouse)
|
||||
signal contactDeletionRequested(FriendGui contact)
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ ListView {
|
|||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
_address: modelData.core.address
|
||||
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
shadowEnabled: false
|
||||
}
|
||||
Text {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ ListView {
|
|||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
_address: modelData.core.sipAddress
|
||||
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
shadowEnabled: false
|
||||
}
|
||||
Text {
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ Item {
|
|||
call: !mainItem.previewEnabled ? mainItem.call : null
|
||||
displayNameVal: mainItem.displayName
|
||||
securityBreach: mainItem.securityBreach ? mainItem.securityBreach : securityLevel === LinphoneEnums.SecurityLevel.Unsafe
|
||||
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
}
|
||||
ColumnLayout{
|
||||
id: joiningView
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ Quick.Text {
|
|||
family: DefaultStyle.defaultFont
|
||||
pixelSize: Math.round(10 * DefaultStyle.dp)
|
||||
weight: Typography.p1.weight
|
||||
bold: true
|
||||
}
|
||||
color: DefaultStyle.main2_600
|
||||
wrapMode: Quick.Text.Wrap
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ Notification {
|
|||
Layout.preferredHeight: Math.round(60 * DefaultStyle.dp)
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
call: mainItem.call
|
||||
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
isConference: mainItem.call && mainItem.call.core.isConference
|
||||
}
|
||||
ColumnLayout {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ FocusScope{
|
|||
anchors.fill: parent
|
||||
_address: modelData
|
||||
shadowEnabled: false
|
||||
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
}
|
||||
Button {
|
||||
Layout.preferredWidth: Math.round(17 * DefaultStyle.dp)
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ FocusScope {
|
|||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
_address: modelData.address
|
||||
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
shadowEnabled: false
|
||||
}
|
||||
Text {
|
||||
|
|
|
|||
|
|
@ -775,6 +775,7 @@ AbstractMainPage {
|
|||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
_address: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerAddress : ""
|
||||
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
}
|
||||
Text {
|
||||
text: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerName : ""
|
||||
|
|
@ -812,6 +813,7 @@ AbstractMainPage {
|
|||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
_address: modelData.address
|
||||
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
shadowEnabled: false
|
||||
}
|
||||
Text {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue