Refresh friends presence status on notify reception.

This commit is contained in:
Julien Wadel 2025-08-28 12:40:02 +02:00
parent 6d1463af06
commit 754841fec1
2 changed files with 17 additions and 2 deletions

View file

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 5.3.1 - undefined
- Publish presence indicator synchronized on default account.
- Remove from GUI a bad account created from Assistant.
- Synchronize contacts presence status.
## 5.3.0 - 2025-08-21
### Fixed
@ -14,8 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Avoid to register the account while activating it.
- Volumes settings based on hardware volumes. Remove software gains.
- Display call duration instead of conference duration.
- Publish presence indicator synchronized on default account.
- Remove from GUI a bad account created from Assistant.
### Added
- Screen Sharing in conference calls

View file

@ -229,5 +229,16 @@ void ContactsListModel::onContactUpdated(const std::shared_ptr<linphone::Friend>
void ContactsListModel::onSyncStatusChanged(linphone::FriendList::SyncStatus status, const std::string & message){
}
void ContactsListModel::onPresenceReceived(const std::list<std::shared_ptr<linphone::Friend>> & friends){
for (auto linphoneFriend : friends) {
if(linphoneFriend) {
QQmlEngine *engine = App::getInstance()->getEngine();
auto haveContact = std::find_if(mList.begin(), mList.end(), [linphoneFriend] (const QSharedPointer<QObject>& item){
return item.objectCast<ContactModel>()->getFriend() == linphoneFriend;
});
if ( haveContact != mList.end()) {
haveContact->objectCast<ContactModel>()->refreshPresence();
}
}
}
}