# HG changeset patch # User Kim Alvefur # Date 1289255509 -3600 # Node ID e1479af7ec9ad93e0584f82cfb33783e8a74be35 # Parent 85b3f2a96edbc9e0410638ff976242b8ebef0e87 plugins.invited: New plugin to join rooms when invited diff -r 85b3f2a96edb -r e1479af7ec9a plugins/invited.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/invited.lua Mon Nov 08 23:31:49 2010 +0100 @@ -0,0 +1,18 @@ +function riddim.plugins.invited(bot) + bot:hook("message", function(event) + local x = event.stanza:get_child("x", "http://jabber.org/protocol/muc#user"); + if x then -- XEP 45 + local invite = x:get_child("invite"); + if invite then + bot:join_room(event.stanza.attr.from); + end + else -- try XEP 249 + x = event.stanza:get_child("x", "jabber:x:conference"); + if x and x.attr.jid then + bot:join_room(x.attr.jid); + end + end + end); +end +--TODO +-- Passwords