mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
mod_mix: Return user jid on join
This commit is contained in:
parent
4a52b73a17
commit
b1e6e408f8
@ -424,6 +424,7 @@ process_mix_join(#iq{to = To, from = From,
|
||||
notify_participant_joined(Mod, ServerHost, To, From, ID, Nick),
|
||||
xmpp:make_iq_result(IQ, #mix_join{id = ID,
|
||||
subscribe = Nodes,
|
||||
jid = make_channel_id(To, ID),
|
||||
nick = Nick,
|
||||
xmlns = XmlNs})
|
||||
catch _:{badmatch, {error, db_failure}} ->
|
||||
@ -646,6 +647,11 @@ make_id(JID, Key) ->
|
||||
Data = jid:encode(jid:tolower(jid:remove_resource(JID))),
|
||||
xmpp_util:hex(misc:crypto_hmac(sha256, Data, Key, 10)).
|
||||
|
||||
-spec make_channel_id(jid(), binary()) -> jid().
|
||||
make_channel_id(JID, ID) ->
|
||||
{U, S, R} = jid:split(JID),
|
||||
jid:make(<<ID/binary, $#, U/binary>>, S, R).
|
||||
|
||||
%%%===================================================================
|
||||
%%% Error generators
|
||||
%%%===================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user