summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/contact
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-08-09 16:31:04 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-08-09 16:32:05 +0200
commit39814edf81ede7413d98eaff86b183c42b4d8287 (patch)
tree300d4e31a400fa985efb7b3a90e37e8a6484616f /apps/contacts/ajax/contact
parent00d7ae8319ad0b48b31df4080fe7da7a848de28d (diff)
downloadnextcloud-server-39814edf81ede7413d98eaff86b183c42b4d8287.tar.gz
nextcloud-server-39814edf81ede7413d98eaff86b183c42b4d8287.zip
Another take at profile photo/thumbnail caching. oc-839.
Diffstat (limited to 'apps/contacts/ajax/contact')
-rw-r--r--apps/contacts/ajax/contact/add.php8
-rw-r--r--apps/contacts/ajax/contact/addproperty.php7
-rw-r--r--apps/contacts/ajax/contact/deleteproperty.php7
-rw-r--r--apps/contacts/ajax/contact/details.php1
-rw-r--r--apps/contacts/ajax/contact/saveproperty.php5
5 files changed, 23 insertions, 5 deletions
diff --git a/apps/contacts/ajax/contact/add.php b/apps/contacts/ajax/contact/add.php
index 6aaf5a9df35..043e947dc4b 100644
--- a/apps/contacts/ajax/contact/add.php
+++ b/apps/contacts/ajax/contact/add.php
@@ -49,4 +49,10 @@ if(!$id) {
exit();
}
-OCP\JSON::success(array('data' => array( 'id' => $id, 'aid' => $aid )));
+OCP\JSON::success(array(
+ 'data' => array(
+ 'id' => $id,
+ 'aid' => $aid,
+ 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U')
+ )
+));
diff --git a/apps/contacts/ajax/contact/addproperty.php b/apps/contacts/ajax/contact/addproperty.php
index ca28140edf1..df064367ef1 100644
--- a/apps/contacts/ajax/contact/addproperty.php
+++ b/apps/contacts/ajax/contact/addproperty.php
@@ -144,4 +144,9 @@ if(!OC_Contacts_VCard::edit($id, $vcard)) {
bailOut($l10n->t('Error adding contact property: '.$name));
}
-OCP\JSON::success(array('data' => array( 'checksum' => $checksum )));
+OCP\JSON::success(array(
+ 'data' => array(
+ 'checksum' => $checksum,
+ 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U'))
+ )
+);
diff --git a/apps/contacts/ajax/contact/deleteproperty.php b/apps/contacts/ajax/contact/deleteproperty.php
index 9c3f09f8610..d7545ff1fbf 100644
--- a/apps/contacts/ajax/contact/deleteproperty.php
+++ b/apps/contacts/ajax/contact/deleteproperty.php
@@ -44,4 +44,9 @@ if(!OC_Contacts_VCard::edit($id, $vcard)) {
bailOut($l10n->t('Error deleting contact property.'));
}
-OCP\JSON::success(array('data' => array( 'id' => $id )));
+OCP\JSON::success(array(
+ 'data' => array(
+ 'id' => $id,
+ 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U'),
+ )
+));
diff --git a/apps/contacts/ajax/contact/details.php b/apps/contacts/ajax/contact/details.php
index 0e07f9ec3d8..c22f18937d7 100644
--- a/apps/contacts/ajax/contact/details.php
+++ b/apps/contacts/ajax/contact/details.php
@@ -53,5 +53,6 @@ if(isset($details['PHOTO'])) {
$details['id'] = $id;
$details['displayname'] = $card['fullname'];
$details['addressbookid'] = $card['addressbookid'];
+$details['lastmodified'] = OC_Contacts_App::lastModified($vcard)->format('U');
OC_Contacts_App::setLastModifiedHeader($vcard);
OCP\JSON::success(array('data' => $details));
diff --git a/apps/contacts/ajax/contact/saveproperty.php b/apps/contacts/ajax/contact/saveproperty.php
index f9880c78834..799038b6f1d 100644
--- a/apps/contacts/ajax/contact/saveproperty.php
+++ b/apps/contacts/ajax/contact/saveproperty.php
@@ -148,5 +148,6 @@ if(!OC_Contacts_VCard::edit($id, $vcard)) {
OCP\JSON::success(array('data' => array(
'line' => $line,
'checksum' => $checksum,
- 'oldchecksum' => $_POST['checksum']))
-);
+ 'oldchecksum' => $_POST['checksum']
+ 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U')
+));