Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 10510:fe0884ddb4f8
mod_admin_telnet: Use common sort function in s2s:show
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 15 Dec 2019 22:15:52 +0100 |
parent | 10509:0aa0fd1adbb0 |
child | 10517:6e1163fa2cd2 |
comparison
equal
deleted
inserted
replaced
10509:0aa0fd1adbb0 | 10510:fe0884ddb4f8 |
---|---|
779 end | 779 end |
780 end | 780 end |
781 | 781 |
782 -- Sort by local host, then remote host | 782 -- Sort by local host, then remote host |
783 table.sort(s2s_list, function(a,b) | 783 table.sort(s2s_list, function(a,b) |
784 if a.l == b.l then return a.r < b.r; end | 784 if a.l == b.l then return _sort_hosts(a.r, b.r); end |
785 return a.l < b.l; | 785 return _sort_hosts(a.l, b.l); |
786 end); | 786 end); |
787 local lasthost; | 787 local lasthost; |
788 for _, sess_lines in ipairs(s2s_list) do | 788 for _, sess_lines in ipairs(s2s_list) do |
789 if sess_lines.l ~= lasthost then print(sess_lines.l); lasthost=sess_lines.l end | 789 if sess_lines.l ~= lasthost then print(sess_lines.l); lasthost=sess_lines.l end |
790 for _, line in ipairs(sess_lines) do print(line); end | 790 for _, line in ipairs(sess_lines) do print(line); end |