Skip to content

Commit

Permalink
feat: allow modifying c2s session info
Browse files Browse the repository at this point in the history
  • Loading branch information
pouriya committed Feb 17, 2021
1 parent 14871c5 commit 821bf93
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ejabberd_sm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 821bf93

Please sign in to comment.