equal
deleted
inserted
replaced
85 require 'lm' |
85 require 'lm' |
86 |
86 |
87 |
87 |
88 -- COMMON SUPPORT ROUTINES |
88 -- COMMON SUPPORT ROUTINES |
89 |
89 |
|
90 -- unused :/ |
90 function shell_escape ( str ) |
91 function shell_escape ( str ) |
91 if str then |
92 if str then |
92 return "'" .. str:gsub ( "'", "'\\''" ) .. "'" |
93 return "'" .. str:gsub ( "'", "'\\''" ) .. "'" |
93 else |
94 else |
94 return "''" |
95 return "''" |
112 return string.format ( "{%s }", jk:sub ( 1, -2 ) ) |
113 return string.format ( "{%s }", jk:sub ( 1, -2 ) ) |
113 else |
114 else |
114 return string.format ( "{%s\n%s%s}", jk, tbls, prefix ) |
115 return string.format ( "{%s\n%s%s}", jk, tbls, prefix ) |
115 end |
116 end |
116 end |
117 end |
117 |
|
118 function online ( jid ) |
|
119 local info = main.buddy_info ( jid ) |
|
120 if not info then |
|
121 return false |
|
122 end |
|
123 for resource, params in pairs ( info.resources ) do |
|
124 if params.status ~= '_' then |
|
125 return true |
|
126 end |
|
127 end |
|
128 return false |
|
129 end |
|
130 |
|
131 -- XXX to C |
|
132 boolean_cid = main.add_category { 'enable', 'disable', 'yes', 'no', 'true', 'false', 'on', 'off' } |
|
133 |
118 |
134 -- COMMANDS |
119 -- COMMANDS |
135 |
120 |
136 -- Help strings should not contain command, only arguments. This is necessary to support soft aliases. |
121 -- Help strings should not contain command, only arguments. This is necessary to support soft aliases. |
137 commands_help = { |
122 commands_help = { |
262 |
247 |
263 -- MARKING |
248 -- MARKING |
264 |
249 |
265 dopath 'marking' |
250 dopath 'marking' |
266 |
251 |
267 -- FORMS (XEP-0004) |
252 -- DATA FORMS (XEP-0004) |
268 |
253 |
269 dopath 'xep0004' |
254 dopath 'xep0004' |
270 |
255 |
271 -- DISCO (XEP-0030) |
256 -- SERVICE DISCOVERY (XEP-0030) |
272 |
257 |
273 dopath 'xep0030' |
258 dopath 'xep0030' |
274 |
259 |
275 -- IBB (XEP-0047) |
260 -- IN-BOUND BYTESTREAMS (XEP-0047) |
276 |
261 |
277 dopath 'xep0047' |
262 dopath 'xep0047' |
278 |
263 |
279 -- PUBLISH-SUBSRIBE (XEP-0060) |
264 -- PUBLISH-SUBSRIBE (XEP-0060) |
280 |
265 |