Software /
code /
prosody
Diff
plugins/mod_admin_telnet.lua @ 6838:229e95aecf41
mod_admin_telnet: Fix indentation
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 18 Sep 2015 16:16:10 +0200 |
parent | 6781:05cd80ec107c |
child | 6839:298182fd2387 |
child | 6927:566e1cfcb814 |
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua Sat Sep 19 17:46:46 2015 +0200 +++ b/plugins/mod_admin_telnet.lua Fri Sep 18 16:16:10 2015 +0200 @@ -830,19 +830,19 @@ (session.close or s2smanager.destroy_session)(session); count = count + 1 ; end - end + end return true, "Closed "..count.." s2s session"..((count == 1 and "") or "s"); end function def_env.s2s:closeall(host) - local count = 0; + local count = 0; local s2s_sessions = module:shared"/*/s2s/sessions"; for _,session in pairs(s2s_sessions) do if not host or session.from_host == host or session.to_host == host then session:close(); - count = count + 1; - end - end + count = count + 1; + end + end if count == 0 then return false, "No sessions to close."; else return true, "Closed "..count.." s2s session"..((count == 1 and "") or "s"); end end