149:014e73c329c5 | 150:af9b9acb10d6 |
---|---|
1 local verse = require "verse"; | 1 local verse = require "verse"; |
2 local xml = require "util.xml"; | |
2 short_opts.i = "interactive"; | 3 short_opts.i = "interactive"; |
3 short_opts.e = "echo"; | 4 short_opts.e = "echo"; |
4 | 5 |
5 return function (opts, args) | 6 return function (opts, args) |
6 if opts.short_help then | 7 if opts.short_help then |
111 }, "*l"); | 112 }, "*l"); |
112 else | 113 else |
113 if not send_xml then | 114 if not send_xml then |
114 send_xml = table.concat(args, " "); | 115 send_xml = table.concat(args, " "); |
115 end | 116 end |
116 conn:send(send_xml); | 117 send_xml = assert(xml.parse(send_xml)); |
117 conn:close(); | 118 if send_xml.name == "iq" then |
119 conn:send_iq(send_xml, function () | |
120 conn:close(); | |
121 end); | |
122 else | |
123 conn:send(send_xml); | |
124 conn:close(); | |
125 end | |
118 end | 126 end |
119 | 127 |
120 end | 128 end |
121 local plugins = {}; | 129 local plugins = {}; |
122 for i=#args,1,-1 do | 130 for i=#args,1,-1 do |