clix.publish_atom: Default to XEP-0277 node, require --title or --content

Sat, 25 Aug 2018 00:19:51 +0200

author
Kim Alvefur <zash@zash.se>
date
Sat, 25 Aug 2018 00:19:51 +0200
changeset 130
11d526d74460
parent 129
e805c014efa9
child 131
58d485001448

clix.publish_atom: Default to XEP-0277 node, require --title or --content

clix/publish_atom.lua file | annotate | diff | comparison | revisions
--- a/clix/publish_atom.lua	Fri Aug 24 23:29:32 2018 +0200
+++ b/clix/publish_atom.lua	Sat Aug 25 00:19:51 2018 +0200
@@ -10,7 +10,7 @@
 		print("Publish an Atom entry to a pubsub node");
 		return;
 	end
-	if opts.help or not opts.node then
+	if opts.help or not (opts.node or opts.title or opts.content) then
 		print("clix publish_atom \\");
 		print("","--service=pubsub.shakespeare.lit \\");
 		print("","--node=princely_musings \\");
@@ -44,7 +44,7 @@
 			end
 		end
 
-		conn.pubsub(opts.service, opts.node):publish(entry_id, nil, atom_entry
+		conn.pubsub(opts.service, opts.node or "urn:xmpp:microblog:0"):publish(entry_id, nil, atom_entry
 		, function(ok)
 			-- TODO Report success?
 			conn:close();

mercurial