clix/mirror.lua

changeset 24
8e157125957d
child 27
5b58c002d6ad
equal deleted inserted replaced
23:c5f04bdc7c64 24:8e157125957d
1 return function (opts, arg)
2 local function on_connect(conn)
3 local function on_stanza(stanza)
4 if stanza.name == "presence" and opts.presence
5 and not opts.mirror_presence then
6 return;
7 end
8 stanza.attr.to, stanza.attr.from = stanza.attr.from, stanza.attr.to;
9 conn:send(stanza);
10 stanza.attr.to, stanza.attr.from = stanza.attr.from, stanza.attr.to;
11 end
12 conn:hook("stanza", on_stanza);
13 end
14 return clix_connect(opts, on_connect);
15 end

mercurial