Skip to content

Commit

Permalink
Merge branch 'jb54060' into 'master'
Browse files Browse the repository at this point in the history
[libcommhistory] Don't group dissimilar non-phone-number senders. Contributes to JB#54060

See merge request mer-core/libcommhistory!56
  • Loading branch information
chriadam committed May 11, 2021
2 parents 2a51534 + f2a37c5 commit d54ae9a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/recipient.cpp
Expand Up @@ -39,8 +39,12 @@ bool initializeTypes()

QString minimizeRemoteUid(const QString &remoteUid, bool isPhoneNumber)
{
// For non-standard localUid values, we still need a comparable value
return isPhoneNumber ? CommHistory::minimizePhoneNumber(remoteUid).toLower() : remoteUid.toLower();
// For non-standard localUid values, we still need a comparable value.
// For non-phone-number remoteUid values (e.g. non-replyable SMS senders), we still need a comparable value.
// In that case, even if isPhoneNumber is true (e.g. is from a SIM modem)
// the minimized form of the number might be empty (due to invalid phone number format).
const QString minimized = isPhoneNumber ? CommHistory::minimizePhoneNumber(remoteUid).toLower() : QString();
return minimized.isEmpty() ? remoteUid.toLower() : minimized;
}

quint32 addressFlagValues(quint64 statusFlags)
Expand Down

0 comments on commit d54ae9a

Please sign in to comment.