plugins/invited.lua

Tue, 09 Nov 2010 03:01:30 +0100

author
Kim Alvefur <zash@zash.se>
date
Tue, 09 Nov 2010 03:01:30 +0100
changeset 41
b00d05814d0d
parent 38
e1479af7ec9a
child 82
ec22d6deb6c0
permissions
-rw-r--r--

plugins.tell: Optinally store !tells in iq:private for persistence (requires json)

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

mercurial