mod_turncredentials: Use iq-get event, to save checking attr.type manually
authorMatthew Wild <mwild1@gmail.com>
Wed, 28 Aug 2013 10:35:56 +0100
changeset 1170 6695c3098025
parent 1169 0ae2c250f274
child 1171 a18effacd384
mod_turncredentials: Use iq-get event, to save checking attr.type manually
mod_turncredentials/mod_turncredentials.lua
--- a/mod_turncredentials/mod_turncredentials.lua	Wed Aug 28 10:35:32 2013 +0100
+++ b/mod_turncredentials/mod_turncredentials.lua	Wed Aug 28 10:35:56 2013 +0100
@@ -15,9 +15,9 @@
     return;
 end
 
-module:hook("iq/host/urn:xmpp:extdisco:1:services", function(event)
+module:hook("iq-get/host/urn:xmpp:extdisco:1:services", function(event)
     local origin, stanza = event.origin, event.stanza;
-    if stanza.attr.type ~= "get" or stanza.tags[1].name ~= "services" or origin.type ~= "c2s" then
+    if stanza.tags[1].name ~= "services" or origin.type ~= "c2s" then
         return;
     end
     local now = os_time() + ttl;