diff --git a/lib/app.php b/lib/app.php index ff348403..48298952 100644 --- a/lib/app.php +++ b/lib/app.php @@ -10,8 +10,10 @@ * This class manages our app actions */ OC_Contacts_App::$l10n = new OC_L10N('contacts'); +OC_Contacts_App::$categories = new OC_VCategories('contacts'); class OC_Contacts_App { public static $l10n; + public static $categories; /** * Render templates/part.details to json output diff --git a/lib/vcard.php b/lib/vcard.php index ece203bd..de95e732 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -114,6 +114,8 @@ class OC_Contacts_VCard{ $card = OC_VObject::parse($data); if(!is_null($card)){ + OC_Contacts_App::$categories->loadFromVObject($card); + $fn = $card->getAsString('FN'); if(!$fn){ // Fix missing 'FN' field. $n = $card->getAsString('N'); @@ -187,6 +189,7 @@ class OC_Contacts_VCard{ $email = null; $card = OC_VObject::parse($data); if(!is_null($card)){ + OC_Contacts_App::$categories->loadFromVObject($card); foreach($card->children as $property){ if($property->name == 'FN'){ $fn = $property->value; @@ -245,6 +248,7 @@ class OC_Contacts_VCard{ $card = OC_VObject::parse($data); if(!is_null($card)){ + OC_Contacts_App::$categories->loadFromVObject($card); foreach($card->children as $property){ if($property->name == 'FN'){ $fn = $property->value; @@ -279,6 +283,7 @@ class OC_Contacts_VCard{ $fn = null; $card = OC_VObject::parse($data); if(!is_null($card)){ + OC_Contacts_App::$categories->loadFromVObject($card); foreach($card->children as $property){ if($property->name == 'FN'){ $fn = $property->value;