mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Rename AddressBook contacts utils convert commands
This commit is contained in:
parent
513b2fcae8
commit
b025bed83c
2 changed files with 5 additions and 5 deletions
|
|
@ -84,9 +84,9 @@ class AddressBook extends AbstractProvider
|
||||||
{
|
{
|
||||||
$iCount = 0;
|
$iCount = 0;
|
||||||
if ($this->IsActive()) {
|
if ($this->IsActive()) {
|
||||||
foreach (Utils::CsvArrayToVCards($aCsvData) as $oContact) {
|
foreach (AddressBook\Utils::CsvArrayToContacts($aCsvData) as $oContact) {
|
||||||
if ($this->ContactSave($oContact)) {
|
if ($this->ContactSave($oContact)) {
|
||||||
$iCount++;
|
++$iCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +99,7 @@ class AddressBook extends AbstractProvider
|
||||||
if ($this->IsActive()) {
|
if ($this->IsActive()) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (Utils::VcfFileToVCards($sVcfData) as $oContact) {
|
foreach (AddressBook\Utils::VcfFileToContacts($sVcfData) as $oContact) {
|
||||||
if ($this->ContactSave($oContact)) {
|
if ($this->ContactSave($oContact)) {
|
||||||
++$iCount;
|
++$iCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ class Utils
|
||||||
/**
|
/**
|
||||||
* TODO: broken
|
* TODO: broken
|
||||||
*/
|
*/
|
||||||
public static function CsvArrayToVCards(array $aCsvData) : iterable
|
public static function CsvArrayToContacts(array $aCsvData) : iterable
|
||||||
{
|
{
|
||||||
foreach ($aCsvData as $aItem) {
|
foreach ($aCsvData as $aItem) {
|
||||||
$oContact = new Classes\Contact();
|
$oContact = new Classes\Contact();
|
||||||
|
|
@ -299,7 +299,7 @@ class Utils
|
||||||
return $sResult;
|
return $sResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function VcfFileToVCards(string $sVcfData) : iterable
|
public static function VcfFileToContacts(string $sVcfData) : iterable
|
||||||
{
|
{
|
||||||
$sVcfData = \trim($sVcfData);
|
$sVcfData = \trim($sVcfData);
|
||||||
if ("\xef\xbb\xbf" === \substr($sVcfData, 0, 3)) {
|
if ("\xef\xbb\xbf" === \substr($sVcfData, 0, 3)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue