Comparison

plugins/adhoc/mod_adhoc.lua @ 6843:161cccfdf015

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Tue, 22 Sep 2015 01:31:52 +0200
parent 6841:be87ab2d611c
child 8460:77e59f8057bf
comparison
equal deleted inserted replaced
6839:298182fd2387 6843:161cccfdf015
32 category = "automation", type = "command-node" }):up(); 32 category = "automation", type = "command-node" }):up();
33 reply:tag("feature", { var = xmlns_cmd }):up(); 33 reply:tag("feature", { var = xmlns_cmd }):up();
34 reply:tag("feature", { var = "jabber:x:data" }):up(); 34 reply:tag("feature", { var = "jabber:x:data" }):up();
35 event.exists = true; 35 event.exists = true;
36 else 36 else
37 return origin.send(st.error_reply(stanza, "auth", "forbidden", "This item is not available to you")); 37 origin.send(st.error_reply(stanza, "auth", "forbidden", "This item is not available to you"));
38 return true;
38 end 39 end
39 elseif node == xmlns_cmd then 40 elseif node == xmlns_cmd then
40 reply:tag("identity", { name = "Ad-Hoc Commands", 41 reply:tag("identity", { name = "Ad-Hoc Commands",
41 category = "automation", type = "command-list" }):up(); 42 category = "automation", type = "command-list" }):up();
42 event.exists = true; 43 event.exists = true;
85 :add_child(commands[node]:cmdtag("canceled") 86 :add_child(commands[node]:cmdtag("canceled")
86 :tag("note", {type="error"}):text("You don't have permission to execute this command"))); 87 :tag("note", {type="error"}):text("You don't have permission to execute this command")));
87 return true 88 return true
88 end 89 end
89 -- User has permission now execute the command 90 -- User has permission now execute the command
90 return adhoc_handle_cmd(commands[node], origin, stanza); 91 adhoc_handle_cmd(commands[node], origin, stanza);
92 return true;
91 end 93 end
92 end 94 end
93 end, 500); 95 end, 500);
94 96
95 local function adhoc_added(event) 97 local function adhoc_added(event)