]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Save last-modified time in REV property if not set
authorBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 14:13:30 +0000 (15:13 +0100)
committerBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 14:14:25 +0000 (15:14 +0100)
apps/contacts/lib/app.php

index 914b480e9b4909c35abd4348425fc23c9248db1e..d8d1d3ac04770cefef755fbb25e05a324266218b 100644 (file)
@@ -97,6 +97,10 @@ class OC_Contacts_App {
                                $vcard->setString('N', 'Unknown;Name;;;');
                        }
                }
+               if (!is_null($vcard) && !isset($vcard->REV)) {
+                       $rev = new DateTime('@'.$card['lastmodified']);
+                       $vcard->setString('REV', $rev->format(DateTime::W3C));
+               }
                return $vcard;
        }