Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonah BrĂ¼chert <jbb@kaidan.im>2022-06-27 11:48:38 +0300
committerbadlop <badlop@gmail.com>2022-08-17 17:37:20 +0300
commitb1e6e408f87edd6d33bba23f0d5bf0bf0bab61a5 (patch)
tree23ffd54fbaff752e44f7118c6bb14a7994a2015e /src
parent4a52b73a17c1e9b486a7f107bc1ecf2bbc4add92 (diff)
mod_mix: Return user jid on join
Diffstat (limited to 'src')
-rw-r--r--src/mod_mix.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mod_mix.erl b/src/mod_mix.erl
index 6ac2bd60c..256715af0 100644
--- a/src/mod_mix.erl
+++ b/src/mod_mix.erl
@@ -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
%%%===================================================================