mod_admin_telnet: Fix sorting of JIDs in c2s:show() family of functions (thanks lookshe and Zash)
authorMatthew Wild <mwild1@gmail.com>
Fri, 22 Jan 2016 13:20:00 +0000
changeset 7093 7aa37d70944b
parent 7090 dd8265ca9327
child 7094 1c3b38f80571
child 7101 5286e79c6829
mod_admin_telnet: Fix sorting of JIDs in c2s:show() family of functions (thanks lookshe and Zash)
plugins/mod_admin_telnet.lua
--- a/plugins/mod_admin_telnet.lua	Tue Jan 19 21:31:02 2016 +0100
+++ b/plugins/mod_admin_telnet.lua	Fri Jan 22 13:20:00 2016 +0000
@@ -557,11 +557,11 @@
 	c2s:sort(function(a, b)
 		if a.host == b.host then
 			if a.username == b.username then
-				return a.resource or "" > b.resource or "";
+				return (a.resource or "") > (b.resource or "");
 			end
-			return a.username or "" > b.username or "";
+			return (a.username or "") > (b.username or "");
 		end
-		return a.host or "" > b.host or "";
+		return (a.host or "") > (b.host or "");
 	end):map(function (session)
 		callback(get_jid(session), session)
 	end);