25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

feat: allow modifying c2s session info

This commit is contained in:
Pouriya 2021-02-17 14:17:01 +03:30 committed by GitHub
parent 14871c54ac
commit 821bf930b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,11 +150,17 @@ route(Packet) ->
-spec open_session(sid(), binary(), binary(), binary(), prio(), info()) -> ok.
open_session(SID, User, Server, Resource, Priority, Info) ->
set_session(SID, User, Server, Resource, Priority, Info),
Info2 = ejabberd_hooks:run_fold(
sm_pre_register_connection_hook,
Server,
Info,
[SID, User, Server, Resource, Priority]
),
set_session(SID, User, Server, Resource, Priority, Info2),
check_for_sessions_to_replace(User, Server, Resource),
JID = jid:make(User, Server, Resource),
ejabberd_hooks:run(sm_register_connection_hook,
JID#jid.lserver, [SID, JID, Info]).
JID#jid.lserver, [SID, JID, Info2]).
-spec open_session(sid(), binary(), binary(), binary(), info()) -> ok.