clix/roster.lua

changeset 110
ded3938232f0
parent 91
7816f24d0fdc
child 121
896a25ed6b1b
--- a/clix/roster.lua	Mon Apr 01 21:29:59 2013 +0200
+++ b/clix/roster.lua	Mon Apr 01 21:25:31 2013 +0200
@@ -97,6 +97,17 @@
 					print(k,type(v) == "table" and table.concat(v, ", ") or v)
 				end
 			end;
+			export = function()
+				local stored_roster = { [false] = { version = conn.roster.ver } }
+				for jid, item in pairs(conn.roster.items) do
+					stored_roster[jid] = {
+						name = item.name;
+						subscription = item.subscription;
+						groups = { unpack(item.groups) };
+					}
+				end
+				print("return "..require"util.serialization".serialize(stored_roster));
+			end
 		}
 		function commands.help ()
 			print("Roster commands");

mercurial