mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 16:06:15 +00:00
Drop spaces from contactcache to dedup some more contacts
This commit is contained in:
parent
38072d3766
commit
5a737b609e
@ -84,11 +84,13 @@ class ContactCache {
|
|||||||
if (is_array($phoneIds)) {
|
if (is_array($phoneIds)) {
|
||||||
$countPhone = count($phoneIds);
|
$countPhone = count($phoneIds);
|
||||||
for ($i=0; $i < $countPhone; $i++) {
|
for ($i=0; $i < $countPhone; $i++) {
|
||||||
$this->pushPhoneNumberToCache($phoneIds[$i], $r["FN"], $configuredCountry);
|
$phoneNumber = preg_replace("#[ ]#","", $phoneIds[$i]);
|
||||||
|
$this->pushPhoneNumberToCache($phoneNumber, $r["FN"], $configuredCountry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->pushPhoneNumberToCache($phoneIds, $r["FN"], $configuredCountry);
|
$phoneNumber = preg_replace("#[ ]#","", $phoneIds);
|
||||||
|
$this->pushPhoneNumberToCache($phoneNumber, $r["FN"], $configuredCountry);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($r["PHOTO"])) {
|
if (isset ($r["PHOTO"])) {
|
||||||
@ -102,7 +104,6 @@ class ContactCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function pushPhoneNumberToCache($rawPhone, $contactName, $country) {
|
private function pushPhoneNumberToCache($rawPhone, $contactName, $country) {
|
||||||
|
|
||||||
$phoneNb = PhoneNumberFormatter::format($country, $rawPhone);
|
$phoneNb = PhoneNumberFormatter::format($country, $rawPhone);
|
||||||
$this->contacts[$phoneNb] = $contactName;
|
$this->contacts[$phoneNb] = $contactName;
|
||||||
// Inverted contacts
|
// Inverted contacts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user