mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
sessionmanager: Fire event before retiring old session
This allows for modules to update fields, which is generally better than maintaining this hard-coded list of transferable properties here.
This commit is contained in:
parent
51bf5f2d34
commit
45978d6be2
1 changed files with 4 additions and 3 deletions
|
@ -126,14 +126,15 @@ local function update_session(to_session, from_session)
|
|||
-- Inform xmppstream of the new session (passed to its callbacks)
|
||||
to_session.stream:set_session(to_session);
|
||||
|
||||
-- Retire the session we've pulled from, to avoid two sessions on the same connection
|
||||
retire_session(from_session);
|
||||
|
||||
-- Notify modules, allowing them to copy further fields or update state
|
||||
prosody.events.fire_event("c2s-session-updated", {
|
||||
session = to_session;
|
||||
from_session = from_session;
|
||||
replaced_conn = replaced_conn;
|
||||
});
|
||||
|
||||
-- Retire the session we've pulled from, to avoid two sessions on the same connection
|
||||
retire_session(from_session);
|
||||
end
|
||||
|
||||
local function destroy_session(session, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue