Software /
code /
prosody
Comparison
core/s2smanager.lua @ 11900:60676b607b6d
s2smanager: Fire s2s-destroyed event to mirror s2s-created
The existing events do not fire for unauthed sessions, for example (because
the type does not match). I deemed changing their behaviour too risky, and
the current behaviour may even be more desirable for some uses.
This means we now have roughly paired events:
- s2s-created -> s2s-destroyed (global only)
- s2sin-established -> s2sin-destroyed (global + host)
- s2sout-established -> s2sout-destroyed (global + host)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 12 Nov 2021 13:30:39 +0000 |
parent | 11418:f4b76e500768 |
child | 12586:4c8941b5b05e |
comparison
equal
deleted
inserted
replaced
11899:6d06068363aa | 11900:60676b607b6d |
---|---|
99 end | 99 end |
100 incoming_s2s[session] = nil; | 100 incoming_s2s[session] = nil; |
101 end | 101 end |
102 | 102 |
103 local event_data = { session = session, reason = reason }; | 103 local event_data = { session = session, reason = reason }; |
104 fire_event("s2s-destroyed", event_data); | |
104 if session.type == "s2sout" then | 105 if session.type == "s2sout" then |
105 fire_event("s2sout-destroyed", event_data); | 106 fire_event("s2sout-destroyed", event_data); |
106 if hosts[session.from_host] then | 107 if hosts[session.from_host] then |
107 hosts[session.from_host].events.fire_event("s2sout-destroyed", event_data); | 108 hosts[session.from_host].events.fire_event("s2sout-destroyed", event_data); |
108 end | 109 end |