Comparison

plugins/mod_admin_telnet.lua @ 5011:83b4d3727b4f

mod_admin_telnet: Add xmpp:ping(from, to), useful for initiating s2s connections
author Kim Alvefur <zash@zash.se>
date Thu, 26 Jul 2012 02:27:24 +0200
parent 5007:76f957b44cf7
child 5013:ab693eea0869
comparison
equal deleted inserted replaced
5010:2f8f388de516 5011:83b4d3727b4f
932 else 932 else
933 return nil, "Could not change password for user: "..err; 933 return nil, "Could not change password for user: "..err;
934 end 934 end
935 end 935 end
936 936
937 def_env.xmpp = {};
938
939 local st = require "util.stanza";
940 function def_env.xmpp:ping(localhost, remotehost)
941 if hosts[localhost] then
942 core_post_stanza(hosts[localhost],
943 st.iq{ from=localhost, to=remotehost, type="get", id="ping" }
944 :tag("ping", {xmlns="urn:xmpp:ping"}));
945 return true, "Sent ping";
946 else
947 return nil, "No such host";
948 end
949 end
950
937 ------------- 951 -------------
938 952
939 function printbanner(session) 953 function printbanner(session)
940 local option = config.get("*", "core", "console_banner"); 954 local option = config.get("*", "core", "console_banner");
941 if option == nil or option == "full" or option == "graphic" then 955 if option == nil or option == "full" or option == "graphic" then