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;
|
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 *Utils::getFriendAddressSecurityLevel(const QString &address) {
|
||||||
VariantObject *data = new VariantObject("getFriendAddressSecurityLevel");
|
VariantObject *data = new VariantObject("getFriendAddressSecurityLevel");
|
||||||
if (!data) return nullptr;
|
if (!data) return nullptr;
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ public:
|
||||||
Q_INVOKABLE static VariantObject *findAvatarByAddress(const QString &address);
|
Q_INVOKABLE static VariantObject *findAvatarByAddress(const QString &address);
|
||||||
Q_INVOKABLE static VariantObject *findFriendByAddress(const QString &address);
|
Q_INVOKABLE static VariantObject *findFriendByAddress(const QString &address);
|
||||||
Q_INVOKABLE static VariantObject *getFriendAddressSecurityLevel(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);
|
static QString generateSavedFilename(const QString &from, const QString &to);
|
||||||
Q_INVOKABLE static VariantObject *isMe(const QString &address);
|
Q_INVOKABLE static VariantObject *isMe(const QString &address);
|
||||||
Q_INVOKABLE static VariantObject *isLocal(const QString &address);
|
Q_INVOKABLE static VariantObject *isLocal(const QString &address);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ ListView {
|
||||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||||
_address: modelData.core.remoteAddress
|
_address: modelData.core.remoteAddress
|
||||||
|
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
isConference: modelData.core.isConference
|
isConference: modelData.core.isConference
|
||||||
shadowEnabled: false
|
shadowEnabled: false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,11 @@ Loader{
|
||||||
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
||||||
property string computedAvatarUri: avatarObj ? avatarObj.value : ''
|
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,
|
// To get the secured property for a specific address,
|
||||||
// override it as secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
// override it as secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
property var securityLevelObj: UtilsCpp.getFriendAddressSecurityLevel(_address)
|
property var securityLevelObj: UtilsCpp.getFriendAddressSecurityLevel(_address)
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ FocusScope {
|
||||||
// Use directly previous initial
|
// Use directly previous initial
|
||||||
property real itemsRightMargin: Math.round(39 * DefaultStyle.dp)
|
property real itemsRightMargin: Math.round(39 * DefaultStyle.dp)
|
||||||
|
|
||||||
property string displayName: searchResultItem? searchResultItem.core.fullName : ""
|
property var displayName: searchResultItem? searchResultItem.core.fullName : ""
|
||||||
property string initial: displayName != "" ? displayName[0].toLocaleLowerCase(ConstantsCpp.DefaultLocale) : ''
|
property var initial: displayName != "" ? displayName[0].toLocaleLowerCase(ConstantsCpp.DefaultLocale) : ''
|
||||||
|
|
||||||
signal clicked(var mouse)
|
signal clicked(var mouse)
|
||||||
signal contactDeletionRequested(FriendGui contact)
|
signal contactDeletionRequested(FriendGui contact)
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ ListView {
|
||||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||||
_address: modelData.core.address
|
_address: modelData.core.address
|
||||||
|
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
shadowEnabled: false
|
shadowEnabled: false
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ ListView {
|
||||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||||
_address: modelData.core.sipAddress
|
_address: modelData.core.sipAddress
|
||||||
|
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
shadowEnabled: false
|
shadowEnabled: false
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ Item {
|
||||||
call: !mainItem.previewEnabled ? mainItem.call : null
|
call: !mainItem.previewEnabled ? mainItem.call : null
|
||||||
displayNameVal: mainItem.displayName
|
displayNameVal: mainItem.displayName
|
||||||
securityBreach: mainItem.securityBreach ? mainItem.securityBreach : securityLevel === LinphoneEnums.SecurityLevel.Unsafe
|
securityBreach: mainItem.securityBreach ? mainItem.securityBreach : securityLevel === LinphoneEnums.SecurityLevel.Unsafe
|
||||||
|
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
}
|
}
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id: joiningView
|
id: joiningView
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ Quick.Text {
|
||||||
family: DefaultStyle.defaultFont
|
family: DefaultStyle.defaultFont
|
||||||
pixelSize: Math.round(10 * DefaultStyle.dp)
|
pixelSize: Math.round(10 * DefaultStyle.dp)
|
||||||
weight: Typography.p1.weight
|
weight: Typography.p1.weight
|
||||||
bold: true
|
|
||||||
}
|
}
|
||||||
color: DefaultStyle.main2_600
|
color: DefaultStyle.main2_600
|
||||||
wrapMode: Quick.Text.Wrap
|
wrapMode: Quick.Text.Wrap
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ Notification {
|
||||||
Layout.preferredHeight: Math.round(60 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(60 * DefaultStyle.dp)
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
call: mainItem.call
|
call: mainItem.call
|
||||||
|
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
isConference: mainItem.call && mainItem.call.core.isConference
|
isConference: mainItem.call && mainItem.call.core.isConference
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ FocusScope{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
_address: modelData
|
_address: modelData
|
||||||
shadowEnabled: false
|
shadowEnabled: false
|
||||||
|
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
Layout.preferredWidth: Math.round(17 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(17 * DefaultStyle.dp)
|
||||||
|
|
|
||||||
|
|
@ -287,6 +287,7 @@ FocusScope {
|
||||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||||
_address: modelData.address
|
_address: modelData.address
|
||||||
|
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
shadowEnabled: false
|
shadowEnabled: false
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
|
|
@ -775,6 +775,7 @@ AbstractMainPage {
|
||||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||||
_address: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerAddress : ""
|
_address: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerAddress : ""
|
||||||
|
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
text: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerName : ""
|
text: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerName : ""
|
||||||
|
|
@ -812,6 +813,7 @@ AbstractMainPage {
|
||||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||||
_address: modelData.address
|
_address: modelData.address
|
||||||
|
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
shadowEnabled: false
|
shadowEnabled: false
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue