[Pkg-mozext-commits] [sage-extension] 12/39: feed parsing update

David Prévot taffit at moszumanska.debian.org
Fri May 1 03:10:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag sage_1_1
in repository sage-extension.

commit c5e15518c15b226db093d12fa12c98f32c9adca5
Author: Peter Andrews <petea at jhu.edu>
Date:   Sat May 29 07:54:10 2004 +0000

    feed parsing update
---
 src/sage/content/feedlib.js       |  6 +++---
 src/sage/content/updatechecker.js | 16 +++++++++++-----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index 2397db0..3dcd933 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -204,10 +204,10 @@ Feed.prototype.getLink = function() {
 }
 
 Feed.prototype.hasLastPubDate = function() {
-	if(this.lastPubDate) {
-		return true;
-	} else {
+	if(!this.lastPubDate) {
 		return false;
+	} else {
+		return true;
 	}
 }
 
diff --git a/src/sage/content/updatechecker.js b/src/sage/content/updatechecker.js
index 29fe547..4c457ca 100755
--- a/src/sage/content/updatechecker.js
+++ b/src/sage/content/updatechecker.js
@@ -74,11 +74,17 @@ var UpdateChecker = {
 	httpLoaded: function(e) {
 		var lastModified = 0;
 		var gettingLastModified = false;
-		
-		try {
-			lastModified = UpdateChecker.httpReq.getResponseHeader("Last-modified");
-			lastModified = new Date(lastModified).getTime() * 1000;
-		} catch(e) {}
+
+		var feed = new Feed(UpdateChecker.httpReq.responseXML);
+
+		if(feed.hasLastPubDate()) {
+			lastModified = feed.getLastPubDate().getTime() * 1000;
+		} else {
+			try {
+				lastModified = UpdateChecker.httpReq.getResponseHeader("Last-modified");
+				lastModified = new Date(lastModified).getTime() * 1000;
+			} catch(e) {}
+		}
 		
 		UpdateChecker.checkResult(true, lastModified);
 	},

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/sage-extension.git



More information about the Pkg-mozext-commits mailing list