comparison mod_s2s_keepalive/mod_s2s_keepalive.lua @ 4204:a5930a185806

mod_s2s_keepalive: Fix name of timestamp function
author Kim Alvefur <zash@zash.se>
date Wed, 14 Oct 2020 18:15:12 +0200
parents c4002aae4ad3
children 593fd9e0a435
comparison
equal deleted inserted replaced
4203:c4002aae4ad3 4204:a5930a185806
13 local ping_hosts = {}; 13 local ping_hosts = {};
14 14
15 for remote_domain, session in pairs(s2sout) do 15 for remote_domain, session in pairs(s2sout) do
16 if session.type ~= "s2sout_unauthed" 16 if session.type ~= "s2sout_unauthed"
17 and (not(keepalive_servers) or keepalive_servers:contains(remote_domain)) then 17 and (not(keepalive_servers) or keepalive_servers:contains(remote_domain)) then
18 session.sends2s(st.iq({ to = remote_domain, type = "get", from = host, id = "keepalive:"..dt.timestamp()}) 18 session.sends2s(st.iq({ to = remote_domain, type = "get", from = host, id = "keepalive:"..dt.datetime()})
19 :tag("ping", { xmlns = "urn:xmpp:ping" }) 19 :tag("ping", { xmlns = "urn:xmpp:ping" })
20 ); 20 );
21 end 21 end
22 end 22 end
23 23
31 end 31 end
32 end 32 end
33 33
34 -- ping remotes we only have s2sin from 34 -- ping remotes we only have s2sin from
35 for remote_domain in pairs(ping_hosts) do 35 for remote_domain in pairs(ping_hosts) do
36 module:send(st.iq({ to = remote_domain, type = "get", from = host, id = "keepalive:"..dt.timestamp() }) 36 module:send(st.iq({ to = remote_domain, type = "get", from = host, id = "keepalive:"..dt.datetime() })
37 :tag("ping", { xmlns = "urn:xmpp:ping" }) 37 :tag("ping", { xmlns = "urn:xmpp:ping" })
38 ); 38 );
39 end 39 end
40 40
41 return keepalive_interval; 41 return keepalive_interval;