Comparison

plugins/mod_register.lua @ 7018:5c3d4254d415

mod_register: Add comment explaining the workaround for replying when the account is being deleted
author Kim Alvefur <zash@zash.se>
date Mon, 21 Dec 2015 14:48:33 +0100
parent 7017:ff734a602886
child 7025:236e8d1ee96c
comparison
equal deleted inserted replaced
7017:ff734a602886 7018:5c3d4254d415
96 session.send(reply); 96 session.send(reply);
97 else -- stanza.attr.type == "set" 97 else -- stanza.attr.type == "set"
98 if query.tags[1] and query.tags[1].name == "remove" then 98 if query.tags[1] and query.tags[1].name == "remove" then
99 local username, host = session.username, session.host; 99 local username, host = session.username, session.host;
100 100
101 -- This one weird trick sends a reply to this stanza before the user is deleted
101 local old_session_close = session.close; 102 local old_session_close = session.close;
102 session.close = function(session, ...) 103 session.close = function(session, ...)
103 session.send(st.reply(stanza)); 104 session.send(st.reply(stanza));
104 return old_session_close(session, ...); 105 return old_session_close(session, ...);
105 end 106 end