Permalink
Browse files

Various fixes, too lazy to split my commit

  • Loading branch information...
eschnou committed Feb 20, 2011
1 parent 15c8ef9 commit 90538306e3aab016e2791aea6e6c4a0be4431e6f
Showing with 5 additions and 4 deletions.
  1. +1 −0 lib/ostatus/atom.js
  2. +1 −1 lib/ostatus/http.js
  3. +2 −2 lib/ostatus/push.js
  4. +1 −1 lib/ostatus/templates/updates.xml.mu
View
@@ -39,6 +39,7 @@ function render(updates, profile, callback) {
var context = profile;
context.updates = updates;
context.host = host;
+ if (updates && updates.length > 0) context.updated = updates[0].updated;
Mu.render(parsed,context)
.on('data', function (c) { buffer += c.toString(); })
.on('end', function () {callback(null, buffer);})
View
@@ -68,7 +68,7 @@ function post(url, reqBody, headers, callback) {
var port = secure ? 443 : 80;
headers["Host"] = host;
- headers["Content-Length"] = reqBody.length;
+ headers["Content-Length"] = reqBody.length + 1;
if (url.search != undefined) path += url.search;
View
@@ -81,7 +81,7 @@ function sign(data, secret) {
function distribute(data, url, secret, callback) {
var headers = {"Content-Type": "application/atom-xml"};
-
+ console.log("Data: ===" + data + "===");
if (secret != undefined) {
var digest = "sha1="+ sign(data, secret);
headers["X-Hub-Signature"] = digest;
@@ -91,7 +91,7 @@ function distribute(data, url, secret, callback) {
Http.post(url, data, headers, function(err, response, body) {
if (err) return callback(err);
if (response.statusCode >= 200 && response.statusCode < 300) {
- callback(null, body);
+ callback(null, response.statusCode, body);
} else {
callback(new Error("Push distribute returned HTTP Status " + response.statusCode));
}
@@ -2,7 +2,7 @@
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/">
<id>http://{{host}}/updates/{{username}}.atom</id>
<title>Latest updates from {{fullname}}</title>
- <updated>2011-01-10T21:29:19+00:00</updated>
+ <updated>{{updated}}</updated>
<link rel="alternate" href="http://{{host}}/users/{{username}}" type="text/html"/>
<link rel="hub" href="http://{{host}}/push/hub" />
<link rel="salmon" href="http://{{host}}/salmon/user/{{username}}" />

0 comments on commit 9053830

Please sign in to comment.