Skip to content

Pending connections list #3690

Discussion options

You must be logged in to vote

I think I found solution with c2s_handle_call hook:

c2s_handle_call(#{mod := Mod, mgmt_state := MgmtState} = State, {get_state}, From) ->
Mod:reply(From, MgmtState),
{stop, State};
c2s_handle_call(State, _Call, _From) ->
State.

Then I get list of user resources for each room in the c2s_session_pending handler and check status of each resource with

PID = ejabberd_sm:get_session_pid(User, Server, Resource),
case ejabberd_c2s:call(PID, {get_state}, timer:seconds(15)) of
active -> true;
_ -> false
end

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by webtoucher
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants