examples/xep0060.lua
changeset 34 8206d7cb1447
parent 27 92b254b64360
equal deleted inserted replaced
33:db5396037b43 34:8206d7cb1447
   304 
   304 
   305 -- INTERFACE
   305 -- INTERFACE
   306 
   306 
   307 main.command ( 'node',
   307 main.command ( 'node',
   308 	function ( args )
   308 	function ( args )
   309 		args = main.parse_args ( args )
       
   310 		local who, action, node = args.t, args[1], args[2]
   309 		local who, action, node = args.t, args[1], args[2]
   311 		if not who then
   310 		if not who then
   312 			who = main.current_buddy ()
   311 			who = main.current_buddy ()
   313 		end
   312 		end
   314 		if action == 'subscribe' then
   313 		if action == 'subscribe' then
   333 		elseif action == 'subscription' or action == 'modify' then -- XXX
   332 		elseif action == 'subscription' or action == 'modify' then -- XXX
   334 			pubsub_modify_subscription ( args.t or main.current_buddy (), node, args[3], args[4], args[5] )
   333 			pubsub_modify_subscription ( args.t or main.current_buddy (), node, args[3], args[4], args[5] )
   335 		else
   334 		else
   336 			print ( 'Error: unknown action' )
   335 			print ( 'Error: unknown action' )
   337 		end
   336 		end
   338 	end )
   337 	end, true )
   339 
   338 
   340 -- FIXME
   339 -- FIXME
   341 commands_help['node']           = "[-t jid] [-m max_items] action [node_name]\n\nAction can be subscribe, unsubscribe, retrieve (items, get), create (new), delete (del), purge (del_items), configure (conf*), subscriptions (subscribers), subscription (modify?)"
   340 commands_help['node']           = "[-t jid] [-m max_items] action [node_name]\n\nAction can be subscribe, unsubscribe, retrieve (items, get), create (new), delete (del), purge (del_items), configure (conf*), subscriptions (subscribers), subscription (modify?)"
   342 --[[
   341 --[[
   343 commands_help['subscribe']      = "[-t jid] node_name\n\nSends pubsub subscription request to specified node of jid or current buddy."
   342 commands_help['subscribe']      = "[-t jid] node_name\n\nSends pubsub subscription request to specified node of jid or current buddy."