Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
[libcontacts] Only index valid phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewvogt committed Oct 15, 2013
1 parent 4af2c39 commit f8bec7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/seasidecache.cpp
Expand Up @@ -1095,6 +1095,11 @@ QString SeasideCache::normalizePhoneNumber(const QString &input)
// TODO: use a configuration variable to make this configurable
static const int maxCharacters = 7;

// If the number if not valid, return null
QString validated(QtContactsSqliteExtensions::normalizePhoneNumber(input, QtContactsSqliteExtensions::ValidatePhoneNumber));
if (validated.isNull())
return validated;

return QtContactsSqliteExtensions::minimizePhoneNumber(input, maxCharacters);
}

Expand Down

0 comments on commit f8bec7a

Please sign in to comment.