From ae52a05c3bec76c62ee47e6c410e399803784f1f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 19 Sep 2009 10:50:22 +0000 Subject: [PATCH] Allow for XML .prop files on WebDAV in the future --- chrome/content/zotero/xpcom/storage/webdav.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index 9b987c3706..ca5ebcd5c1 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -203,13 +203,26 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._getStorageModificationTime = funct Zotero.debug(req.responseText); - var mtime = req.responseText; // No modification time set - if (!mtime) { + if (!req.responseText) { callback(item, false); return; } + try { + var xml = new XML(req.responseText); + } + catch (e) { + var xml = null; + } + if (xml && xml.childNodes.length()) { + // TODO: other stuff, but this makes us forward-compatible + mtime = xml.mtime.toString(); + } + else { + mtime = req.responseText; + } + var mdate = new Date(mtime * 1000); callback(item, mdate); });