Software / code / prosody
Comparison
plugins/mod_register.lua @ 7711:c8130995d4d1
mod_register: Rename session reference in wrapped close method [luacheck]
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 02 Nov 2016 13:34:09 +0100 |
| parent | 7710:08f5b483ff00 |
| child | 7754:560d2e758d4c |
comparison
equal
deleted
inserted
replaced
| 7710:08f5b483ff00 | 7711:c8130995d4d1 |
|---|---|
| 99 if query.tags[1] and query.tags[1].name == "remove" then | 99 if query.tags[1] and query.tags[1].name == "remove" then |
| 100 local username, host = session.username, session.host; | 100 local username, host = session.username, session.host; |
| 101 | 101 |
| 102 -- This one weird trick sends a reply to this stanza before the user is deleted | 102 -- This one weird trick sends a reply to this stanza before the user is deleted |
| 103 local old_session_close = session.close; | 103 local old_session_close = session.close; |
| 104 session.close = function(session, ...) | 104 session.close = function(self, ...) |
| 105 session.send(st.reply(stanza)); | 105 self.send(st.reply(stanza)); |
| 106 return old_session_close(session, ...); | 106 return old_session_close(self, ...); |
| 107 end | 107 end |
| 108 | 108 |
| 109 local ok, err = usermanager_delete_user(username, host); | 109 local ok, err = usermanager_delete_user(username, host); |
| 110 | 110 |
| 111 if not ok then | 111 if not ok then |