Remove fallback displayname on logs and chat rooms.

Add a printObject() for javascript variables.
This commit is contained in:
Julien Wadel 2022-07-04 10:53:17 +02:00
parent e327d0bf3a
commit 865b14f4eb
3 changed files with 27 additions and 5 deletions

View file

@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Crash on exit.
- Memory stability.
## 4.4.8 - 2022-07-04
### Fixes
- Display name are based on friends (coming from local or LDAP server) and caller address only.
## 4.4.7 - 2022-07-01
### Fixes

View file

@ -83,7 +83,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> call){
mMagicSearch->addListener(mSearch);
mRemoteAddress = mCall->getRemoteAddress()->clone();
mMagicSearch->getContactListFromFilterAsync(mRemoteAddress->getUsername(),mRemoteAddress->getDomain());
mMagicSearch->getContactsListAsync(mRemoteAddress->getUsername(),mRemoteAddress->getDomain(), (int)linphone::MagicSearchSource::LdapServers | (int)linphone::MagicSearchSource::Friends, linphone::MagicSearchAggregation::Friend);
}
CallModel::~CallModel () {
@ -707,10 +707,11 @@ void CallModel::toggleSpeakerMute(){
// -----------------------------------------------------------------------------
// Set remote display name when a search has been done
// Local Friend > LDAP friend > Address > others
void CallModel::searchReceived(std::list<std::shared_ptr<linphone::SearchResult>> results){
bool found = false;
for(auto it = results.begin() ; it != results.end() && !found ; ++it){
if((*it)->getFriend()){
if((*it)->getFriend()){// Local Friend
if((*it)->getFriend()->getAddress()->weakEqual(mRemoteAddress)){
setRemoteDisplayName((*it)->getFriend()->getName());
found = true;
@ -718,9 +719,16 @@ void CallModel::searchReceived(std::list<std::shared_ptr<linphone::SearchResult>
}else{
if((*it)->getAddress()->weakEqual(mRemoteAddress)){
std::string newDisplayName = (*it)->getAddress()->getDisplayName();
if( ((*it)->getSourceFlags() & (int) linphone::MagicSearchSource::CallLogs) == 0 || newDisplayName.empty())
setRemoteDisplayName(newDisplayName);
found = true;
if(!newDisplayName.empty()){
// LDAP friend
if( ((*it)->getSourceFlags() & (int) linphone::MagicSearchSource::LdapServers) == (int) linphone::MagicSearchSource::LdapServers){
setRemoteDisplayName(newDisplayName);
found = true;
}else if( Utils::coreStringToAppString(mRemoteAddress->getDisplayName()).isEmpty()){
setRemoteDisplayName(newDisplayName);
found = true;
}
}
}
}
}

View file

@ -693,3 +693,12 @@ function write (fileName, text) {
request.open('PUT', getUriFromSystemPath(fileName), false)
request.send(text)
}
function printObject(o) {
var out = '';
for (var p in o) {
out += p + ': ' + o[p] + '\n';
}
return out;
}