summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/lib/addressbook.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index 92c5f4da3a7..810c681fe51 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -66,7 +66,8 @@ class OC_Contacts_Addressbook {
}
$addressbooks = array_merge($addressbooks, OCP\Share::getItemsSharedWith('addressbook', OC_Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS));
if(!$active && !count($addressbooks)) {
- self::addDefault($uid);
+ $id = self::addDefault($uid);
+ return array(self::find($id),);
}
return $addressbooks;
}
@@ -139,7 +140,7 @@ class OC_Contacts_Addressbook {
}
return $id;
}
-
+
/**
* @brief Creates a new address book
* @param string $userid
@@ -290,7 +291,7 @@ class OC_Contacts_Addressbook {
OCP\Util::writeLog('contacts', __CLASS__.'::'.__METHOD__.', exception for '.$id.': '.$e->getMessage(), OCP\Util::ERROR);
return false;
}
-
+
$cards = OC_Contacts_VCard::all($id);
foreach($cards as $card){
OC_Contacts_VCard::delete($card['id']);