Changeset

71:075ecfa46484

clix.publish_atom: Don't quit until the server responds to our publish request.
author Kim Alvefur <zash@zash.se>
date Sun, 19 Feb 2012 23:50:09 +0100
parents 70:5e93cfc73444
children 72:0f69e1902f5b
files clix/publish_atom.lua
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/clix/publish_atom.lua	Sun Feb 12 20:45:06 2012 +0000
+++ b/clix/publish_atom.lua	Sun Feb 19 23:50:09 2012 +0100
@@ -35,10 +35,13 @@
 			atom_entry:tag("content"):text(opts.content):up();
 		end
 
-		conn.pubsub(opts.service, opts.node):publish(entry_id, nil, atom_entry);
+		conn.pubsub(opts.service, opts.node):publish(entry_id, nil, atom_entry
+		, function(ok)
+			-- TODO Report success?
+			conn:close();
+		end);
 
 		--conn:send(verse.message({ to = opts.to, type = "chat" }) :body(text));
-		conn:close();
 	end
 	clix_connect(opts, on_connect);
 end