clix/roster.lua

changeset 168
75e8ca131178
parent 164
fafdcde2e2eb
equal deleted inserted replaced
167:57bb6e03d239 168:75e8ca131178
1 local verse = require "verse" 1 local verse = require "verse"
2 short_opts.i = "interactive"; 2 short_opts.i = "interactive";
3 local split_jid = require "util.jid".split; 3 local split_jid = require "prosody.util.jid".split;
4 local function printor(str) 4 local function printor(str)
5 return function(ok, err) 5 return function(ok, err)
6 if ok then 6 if ok then
7 print(str) 7 print(str)
8 else 8 else
113 name = item.name; 113 name = item.name;
114 subscription = item.subscription; 114 subscription = item.subscription;
115 groups = { unpack(item.groups) }; 115 groups = { unpack(item.groups) };
116 } 116 }
117 end 117 end
118 print("return "..require"util.serialization".serialize(stored_roster)); 118 print("return "..require"prosody.util.serialization".serialize(stored_roster));
119 end 119 end
120 } 120 }
121 function commands.help () 121 function commands.help ()
122 print("Roster commands"); 122 print("Roster commands");
123 for cmd in pairs(commands) do 123 for cmd in pairs(commands) do
130 local param = text:match("%s+(.*)", #cmd); 130 local param = text:match("%s+(.*)", #cmd);
131 if commands[cmd] then 131 if commands[cmd] then
132 commands[cmd](param); 132 commands[cmd](param);
133 end 133 end
134 end 134 end
135 stdin = require "net.server".wrapclient(stdin, "stdin", 0, { 135 stdin = verse.server.wrapclient(stdin, "stdin", 0, {
136 onincoming = on_incoming, ondisconnect = function () end 136 onincoming = on_incoming, ondisconnect = function () end
137 }, "*l"); 137 }, "*l");
138 conn:add_plugin("roster"); 138 conn:add_plugin("roster");
139 conn.roster:fetch(function(roster) 139 conn.roster:fetch(function(roster)
140 if not roster then 140 if not roster then

mercurial