plugins/invited.lua

changeset 38
e1479af7ec9a
child 82
ec22d6deb6c0
equal deleted inserted replaced
37:85b3f2a96edb 38:e1479af7ec9a
1 function riddim.plugins.invited(bot)
2 bot:hook("message", function(event)
3 local x = event.stanza:get_child("x", "http://jabber.org/protocol/muc#user");
4 if x then -- XEP 45
5 local invite = x:get_child("invite");
6 if invite then
7 bot:join_room(event.stanza.attr.from);
8 end
9 else -- try XEP 249
10 x = event.stanza:get_child("x", "jabber:x:conference");
11 if x and x.attr.jid then
12 bot:join_room(x.attr.jid);
13 end
14 end
15 end);
16 end
17 --TODO
18 -- Passwords

mercurial