Skip to content
Snippets Groups Projects
Commit ad5aa5ac authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Try to conserve some memory. Should fix oc-1106 for stable4.

parent 42a5cd21
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,14 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
$contacts = OC_Contacts_VCard::all($ids);
$allcontacts = OC_Contacts_VCard::all($ids);
$contacts = array();
foreach($allcontacts as $contact) { // try to conserve some memory
$contacts[] = array('id' => $contact['id'], 'addressbookid' => $contact['addressbookid'], 'fullname' => $contact['fullname']);
}
unset($allcontacts);
$addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
$tmpl = new OCP\Template("contacts", "part.contacts");
$tmpl->assign('contacts', $contacts);
$page = $tmpl->fetchPage();
......
......@@ -14,8 +14,12 @@ OCP\App::checkAppEnabled('contacts');
// Get active address books. This creates a default one if none exists.
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
$contacts = OC_Contacts_VCard::all($ids);
$allcontacts = OC_Contacts_VCard::all($ids);
$contacts = array();
foreach($allcontacts as $contact) { // try to conserve some memory
$contacts[] = array('id' => $contact['id'], 'addressbookid' => $contact['addressbookid'], 'fullname' => $contact['fullname']);
}
unset($allcontacts);
$addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
// Load the files we need
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment