LINQT-1531: Fix call history display names.
This commit is contained in:
parent
fb29ddb4c4
commit
cfe3c49a68
3 changed files with 36 additions and 18 deletions
|
|
@ -99,6 +99,15 @@ void CallHistoryCore::setSelf(QSharedPointer<CallHistoryCore> me) {
|
||||||
[this, remoteAddress = mRemoteAddress](const std::shared_ptr<linphone::Friend> &f) {
|
[this, remoteAddress = mRemoteAddress](const std::shared_ptr<linphone::Friend> &f) {
|
||||||
auto friendModel = Utils::makeQObject_ptr<FriendModel>(f);
|
auto friendModel = Utils::makeQObject_ptr<FriendModel>(f);
|
||||||
auto displayName = friendModel->getFullName();
|
auto displayName = friendModel->getFullName();
|
||||||
|
auto fAddress = ToolModel::interpretUrl(remoteAddress);
|
||||||
|
bool isThisFriend = false;
|
||||||
|
for (auto f : friendModel->getAddresses()) {
|
||||||
|
if (f->weakEqual(fAddress)) {
|
||||||
|
isThisFriend = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isThisFriend)
|
||||||
mCoreModelConnection->invokeToCore([this, friendModel, displayName]() {
|
mCoreModelConnection->invokeToCore([this, friendModel, displayName]() {
|
||||||
mFriendModel = friendModel;
|
mFriendModel = friendModel;
|
||||||
auto me = mCoreModelConnection->mCore.mQData; // Locked from previous call.
|
auto me = mCoreModelConnection->mCore.mQData; // Locked from previous call.
|
||||||
|
|
@ -117,6 +126,7 @@ void CallHistoryCore::setSelf(QSharedPointer<CallHistoryCore> me) {
|
||||||
mDisplayName = displayName;
|
mDisplayName = displayName;
|
||||||
emit displayNameChanged();
|
emit displayNameChanged();
|
||||||
}
|
}
|
||||||
|
emit friendAdded();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void durationChanged(QString duration);
|
void durationChanged(QString duration);
|
||||||
void displayNameChanged();
|
void displayNameChanged();
|
||||||
|
void friendAdded(); // When a friend is created, this log is linked to it.
|
||||||
void removed();
|
void removed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -310,6 +310,13 @@ AbstractMainPage {
|
||||||
anchors.topMargin: 5 * DefaultStyle.dp
|
anchors.topMargin: 5 * DefaultStyle.dp
|
||||||
anchors.bottomMargin: 5 * DefaultStyle.dp
|
anchors.bottomMargin: 5 * DefaultStyle.dp
|
||||||
visible: !!modelData
|
visible: !!modelData
|
||||||
|
Connections{
|
||||||
|
target: modelData?.core
|
||||||
|
// Update contact with the new friend.
|
||||||
|
function onFriendAdded(){
|
||||||
|
historyAvatar.contactObj = UtilsCpp.findFriendByAddress(modelData.core.remoteAddress)
|
||||||
|
}
|
||||||
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
z: 1
|
z: 1
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue