# HG changeset patch # User Kim Alvefur # Date 1310477965 -7200 # Node ID ec22d6deb6c0dc902061b6496d814f152d8d7650 # Parent f86c79cabc752cde8a6b3495749a9c624eeae6fb plugins.invited: Move xmlns-es to variables. diff -r f86c79cabc75 -r ec22d6deb6c0 plugins/invited.lua --- a/plugins/invited.lua Thu Apr 07 02:20:48 2011 +0200 +++ b/plugins/invited.lua Tue Jul 12 15:39:25 2011 +0200 @@ -1,13 +1,17 @@ +local xmlns_muc = "http://jabber.org/protocol/muc"; +local xmlns_muc_user = xmlns_muc .. "#user"; +local xmlns_jxc = "jabber:x:conference"; + function riddim.plugins.invited(bot) bot:hook("message", function(event) - local x = event.stanza:get_child("x", "http://jabber.org/protocol/muc#user"); + local x = event.stanza:get_child("x", xmlns_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"); + x = event.stanza:get_child("x", xmlns_jxc); if x and x.attr.jid then bot:join_room(x.attr.jid); end