Software /
code /
prosody
Comparison
plugins/mod_component.lua @ 4734:4d43dbd6de17
mod_component: Return true after denying a second component connection for a host (thanks xnyhps)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 27 Apr 2012 22:37:24 +0100 |
parent | 4655:9159546cb2f3 |
child | 4757:5fb68e68ba0b |
comparison
equal
deleted
inserted
replaced
4733:791388f90156 | 4734:4d43dbd6de17 |
---|---|
67 end | 67 end |
68 | 68 |
69 if env.connected then | 69 if env.connected then |
70 module:log("error", "Second component attempted to connect, denying connection"); | 70 module:log("error", "Second component attempted to connect, denying connection"); |
71 session:close{ condition = "conflict", text = "Component already connected" }; | 71 session:close{ condition = "conflict", text = "Component already connected" }; |
72 return true; | |
72 end | 73 end |
73 | 74 |
74 env.connected = true; | 75 env.connected = true; |
75 send = session.send; | 76 send = session.send; |
76 session.on_destroy = on_destroy; | 77 session.on_destroy = on_destroy; |