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

Commit

Permalink
Merge pull request #48 from matthewvogt/only-index-valid
Browse files Browse the repository at this point in the history
[libcontacts] Only index valid phone numbers
  • Loading branch information
matthewvogt committed Oct 15, 2013
2 parents 4af2c39 + f8bec7a commit f3a0747
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 f3a0747

Please sign in to comment.