summaryrefslogtreecommitdiff
path: root/src/mod_mix.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_mix.erl')
-rw-r--r--src/mod_mix.erl29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/mod_mix.erl b/src/mod_mix.erl
index 002ef569..c278f214 100644
--- a/src/mod_mix.erl
+++ b/src/mod_mix.erl
@@ -350,7 +350,7 @@ format_status(_Opt, Status) ->
%%%===================================================================
-spec process_mix_create(iq()) -> iq().
process_mix_create(#iq{to = To, from = From,
- sub_els = [#mix_create{channel = Chan}]} = IQ) ->
+ sub_els = [#mix_create{channel = Chan, xmlns = XmlNs}]} = IQ) ->
Host = To#jid.lserver,
ServerHost = ejabberd_router:host_of_route(Host),
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
@@ -374,7 +374,7 @@ process_mix_create(#iq{to = To, from = From,
end,
case Ret of
ok ->
- xmpp:make_iq_result(IQ, #mix_create{channel = Chan1});
+ xmpp:make_iq_result(IQ, #mix_create{channel = Chan1, xmlns = XmlNs});
{error, conflict} ->
xmpp:make_error(IQ, channel_exists_error(IQ));
{error, db_failure} ->
@@ -384,7 +384,7 @@ process_mix_create(#iq{to = To, from = From,
-spec process_mix_destroy(iq()) -> iq().
process_mix_destroy(#iq{to = To,
from = #jid{luser = U, lserver = S},
- sub_els = [#mix_destroy{channel = Chan}]} = IQ) ->
+ sub_els = [#mix_destroy{channel = Chan, xmlns = XmlNs}]} = IQ) ->
Host = To#jid.lserver,
ServerHost = ejabberd_router:host_of_route(Host),
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
@@ -392,7 +392,7 @@ process_mix_destroy(#iq{to = To,
{ok, {#jid{luser = U, lserver = S}, _, _}} ->
case Mod:del_channel(ServerHost, Chan, Host) of
ok ->
- xmpp:make_iq_result(IQ, #mix_destroy{channel = Chan});
+ xmpp:make_iq_result(IQ, #mix_destroy{channel = Chan, xmlns = XmlNs});
{error, db_failure} ->
xmpp:make_error(IQ, db_error(IQ))
end;
@@ -406,7 +406,7 @@ process_mix_destroy(#iq{to = To,
-spec process_mix_join(iq()) -> iq().
process_mix_join(#iq{to = To, from = From,
- sub_els = [#mix_join{} = JoinReq]} = IQ) ->
+ sub_els = [#mix_join{xmlns = XmlNs} = JoinReq]} = IQ) ->
Chan = To#jid.luser,
Host = To#jid.lserver,
ServerHost = ejabberd_router:host_of_route(Host),
@@ -423,7 +423,8 @@ 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,
- nick = Nick})
+ nick = Nick,
+ xmlns = XmlNs})
catch _:{badmatch, {error, db_failure}} ->
xmpp:make_error(IQ, db_error(IQ))
end;
@@ -435,7 +436,7 @@ process_mix_join(#iq{to = To, from = From,
-spec process_mix_leave(iq()) -> iq().
process_mix_leave(#iq{to = To, from = From,
- sub_els = [#mix_leave{}]} = IQ) ->
+ sub_els = [#mix_leave{xmlns = XmlNs}]} = IQ) ->
{Chan, Host, _} = jid:tolower(To),
ServerHost = ejabberd_router:host_of_route(Host),
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
@@ -453,7 +454,7 @@ process_mix_leave(#iq{to = To, from = From,
xmpp:make_error(IQ, db_error(IQ))
end;
{error, notfound} ->
- xmpp:make_iq_result(IQ, #mix_leave{});
+ xmpp:make_iq_result(IQ, #mix_leave{xmlns = XmlNs});
{error, db_failure} ->
xmpp:make_error(IQ, db_error(IQ))
end;
@@ -465,7 +466,7 @@ process_mix_leave(#iq{to = To, from = From,
-spec process_mix_setnick(iq()) -> iq().
process_mix_setnick(#iq{to = To, from = From,
- sub_els = [#mix_setnick{nick = Nick}]} = IQ) ->
+ sub_els = [#mix_setnick{nick = Nick, xmlns = XmlNs}]} = IQ) ->
{Chan, Host, _} = jid:tolower(To),
ServerHost = ejabberd_router:host_of_route(Host),
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
@@ -474,12 +475,12 @@ process_mix_setnick(#iq{to = To, from = From,
{ok, _} ->
case Mod:get_participant(ServerHost, Chan, Host, BFrom) of
{ok, {_, Nick}} ->
- xmpp:make_iq_result(IQ, #mix_setnick{nick = Nick});
+ xmpp:make_iq_result(IQ, #mix_setnick{nick = Nick, xmlns = XmlNs});
{ok, {ID, _}} ->
case Mod:set_participant(ServerHost, Chan, Host, BFrom, ID, Nick) of
ok ->
notify_participant_joined(Mod, ServerHost, To, From, ID, Nick),
- xmpp:make_iq_result(IQ, #mix_setnick{nick = Nick});
+ xmpp:make_iq_result(IQ, #mix_setnick{nick = Nick, xmlns = XmlNs});
{error, db_failure} ->
xmpp:make_error(IQ, db_error(IQ))
end;
@@ -688,12 +689,16 @@ register_iq_handlers(Host) ->
?MODULE, process_disco_items),
gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_MIX_CORE_0,
?MODULE, process_mix_core),
+ gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_MIX_CORE_1,
+ ?MODULE, process_mix_core),
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_DISCO_INFO,
?MODULE, process_disco_info),
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_DISCO_ITEMS,
?MODULE, process_disco_items),
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_MIX_CORE_0,
?MODULE, process_mix_core),
+ gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_MIX_CORE_1,
+ ?MODULE, process_mix_core),
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_PUBSUB,
?MODULE, process_pubsub_query),
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_MAM_2,
@@ -704,8 +709,10 @@ unregister_iq_handlers(Host) ->
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_DISCO_INFO),
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_DISCO_ITEMS),
gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_MIX_CORE_0),
+ gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_MIX_CORE_1),
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_DISCO_INFO),
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_DISCO_ITEMS),
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_MIX_CORE_0),
+ gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_MIX_CORE_1),
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_PUBSUB),
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_MAM_2).