Software /
code /
prosody
Diff
plugins/mod_legacyauth.lua @ 6302:76699a0ae4c4
mod_lastactivity, mod_legacyauth, mod_presence, mod_saslauth, mod_tls: Use the newer stanza:get_child APIs and optimize away some table lookups
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 04 Jul 2014 22:52:34 +0200 |
parent | 5776:bd0ff8ae98a8 |
child | 6487:edc63dc72566 |
line wrap: on
line diff
--- a/plugins/mod_legacyauth.lua Fri Jul 04 21:48:25 2014 +0200 +++ b/plugins/mod_legacyauth.lua Fri Jul 04 22:52:34 2014 +0200 @@ -44,9 +44,10 @@ return true; end - local username = stanza.tags[1]:child_with_name("username"); - local password = stanza.tags[1]:child_with_name("password"); - local resource = stanza.tags[1]:child_with_name("resource"); + local query = stanza.tags[1]; + local username = query:get_child("username"); + local password = query:get_child("password"); + local resource = query:get_child("resource"); if not (username and password and resource) then local reply = st.reply(stanza); session.send(reply:query("jabber:iq:auth")