Software / code / prosody
Comparison
plugins/mod_dialback.lua @ 4227:6b83ef6ec845
mod_dialback: Use session:close() on dialback failure instead of s2smanager.destroy_session() (thanks Zash)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 21 Mar 2011 19:32:51 +0000 |
| parent | 3534:c68590b13a6d |
| child | 4238:05f991b4a90e |
| child | 4314:1e1110840965 |
comparison
equal
deleted
inserted
replaced
| 4224:8b8d2b8e4d0b | 4227:6b83ef6ec845 |
|---|---|
| 10 local hosts = _G.hosts; | 10 local hosts = _G.hosts; |
| 11 local send_s2s = require "core.s2smanager".send_to_host; | 11 local send_s2s = require "core.s2smanager".send_to_host; |
| 12 local s2s_make_authenticated = require "core.s2smanager".make_authenticated; | 12 local s2s_make_authenticated = require "core.s2smanager".make_authenticated; |
| 13 local s2s_initiate_dialback = require "core.s2smanager".initiate_dialback; | 13 local s2s_initiate_dialback = require "core.s2smanager".initiate_dialback; |
| 14 local s2s_verify_dialback = require "core.s2smanager".verify_dialback; | 14 local s2s_verify_dialback = require "core.s2smanager".verify_dialback; |
| 15 local s2s_destroy_session = require "core.s2smanager".destroy_session; | |
| 16 | 15 |
| 17 local log = module._log; | 16 local log = module._log; |
| 18 | 17 |
| 19 local st = require "util.stanza"; | 18 local st = require "util.stanza"; |
| 20 | 19 |
| 124 return true; | 123 return true; |
| 125 end | 124 end |
| 126 if stanza.attr.type == "valid" then | 125 if stanza.attr.type == "valid" then |
| 127 s2s_make_authenticated(origin, attr.from); | 126 s2s_make_authenticated(origin, attr.from); |
| 128 else | 127 else |
| 129 s2s_destroy_session(origin) | 128 origin:close("not-authorized", "dialback authentication failed"); |
| 130 end | 129 end |
| 131 return true; | 130 return true; |
| 132 end | 131 end |
| 133 end); | 132 end); |
| 134 | 133 |