{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.22"}}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.11"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.30"}}},
- {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.1.21"}}},
+ {xmpp, ".*", {git, "https://github.com/processone/xmpp", "d958206"}},
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.14"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}},
{p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.3"}}},
Txt = <<"No items found in this query">>,
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang));
#block{items = Items} ->
- JIDs = [jid:tolower(Item) || Item <- Items],
+ JIDs = [jid:tolower(JID) || #block_item{jid = JID} <- Items],
process_block(IQ, JIDs);
#unblock{items = []} ->
process_unblock_all(IQ);
#unblock{items = Items} ->
- JIDs = [jid:tolower(Item) || Item <- Items],
+ JIDs = [jid:tolower(JID) || #block_item{jid = JID} <- Items],
process_unblock(IQ, JIDs);
_ ->
Txt = <<"No module is handling this query">>,
end) of
ok ->
mod_privacy:push_list_update(From, Name),
- Items = [jid:make(LJID) || LJID <- LJIDs],
+ Items = [#block_item{jid = jid:make(LJID)}
+ || LJID <- LJIDs],
broadcast_event(From, #block{items = Items}),
xmpp:make_iq_result(IQ);
{error, notfound} ->
case mod_privacy:set_list(LUser, LServer, Name, NewList) of
ok ->
mod_privacy:push_list_update(From, Name),
- Items = [jid:make(LJID) || LJID <- LJIDs],
+ Items = [#block_item{jid = jid:make(LJID)}
+ || LJID <- LJIDs],
broadcast_event(From, #unblock{items = Items}),
xmpp:make_iq_result(IQ);
{error, _} ->
err_db_failure(IQ)
end;
error ->
- Items = [jid:make(LJID) || LJID <- LJIDs],
+ Items = [#block_item{jid = jid:make(LJID)}
+ || LJID <- LJIDs],
broadcast_event(From, #unblock{items = Items}),
xmpp:make_iq_result(IQ);
{error, _} ->
case mod_privacy:get_user_list(LUser, LServer, default) of
{ok, {_, List}} ->
LJIDs = listitems_to_jids(List, []),
- Items = [jid:make(J) || J <- LJIDs],
+ Items = [#block_item{jid = jid:make(J)} || J <- LJIDs],
xmpp:make_iq_result(IQ, #block_list{items = Items});
error ->
xmpp:make_iq_result(IQ, #block_list{});
malformed_get(Config) ->
JID = jid:make(randoms:get_string()),
+ Item = #block_item{jid = JID},
lists:foreach(
fun(SubEl) ->
#iq{type = error} =
#privacy_query{default = none},
#privacy_query{lists = [#privacy_list{name = <<"1">>},
#privacy_list{name = <<"2">>}]},
- #block{items = [JID]}, #unblock{items = [JID]},
+ #block{items = [Item]}, #unblock{items = [Item]},
#block{}, #unblock{}]),
disconnect(Config).
#privacy_list{name = <<"2">>}]},
#block{},
#block_list{},
- #block_list{items = [jid:make(randoms:get_string())]}]),
+ #block_list{
+ items = [#block_item{
+ jid = jid:make(randoms:get_string())}]}]),
disconnect(Config).
malformed_type_value(Config) ->
get_block(Config) ->
case send_recv(Config, #iq{type = get, sub_els = [#block_list{}]}) of
- #iq{type = result, sub_els = [#block_list{items = JIDs}]} ->
- lists:sort(JIDs);
+ #iq{type = result, sub_els = [#block_list{items = Items}]} ->
+ lists:sort([JID || #block_item{jid = JID} <- Items]);
#iq{type = error} = Err ->
xmpp:get_error(Err)
end.
set_block(Config, JIDs) ->
+ Items = [#block_item{jid = JID} || JID <- JIDs],
case send_recv(Config, #iq{type = set,
- sub_els = [#block{items = JIDs}]}) of
+ sub_els = [#block{items = Items}]}) of
#iq{type = result, sub_els = []} ->
- {#iq{id = I1, sub_els = [#block{items = Items}]},
+ {#iq{id = I1, sub_els = [#block{items = Items1}]},
#iq{id = I2, sub_els = [#privacy_query{lists = Lists}]}} =
?recv2(#iq{type = set, sub_els = [#block{}]},
#iq{type = set, sub_els = [#privacy_query{}]}),
send(Config, #iq{type = result, id = I1}),
send(Config, #iq{type = result, id = I2}),
ct:comment("Checking if all JIDs present in the push"),
- true = lists:sort(JIDs) == lists:sort(Items),
+ true = lists:sort(Items) == lists:sort(Items1),
ct:comment("Getting name of the corresponding privacy list"),
[#privacy_list{name = Name}] = Lists,
{ok, Name};
set_unblock(Config, JIDs) ->
ct:comment("Unblocking ~p", [JIDs]),
+ Items = [#block_item{jid = JID} || JID <- JIDs],
case send_recv(Config, #iq{type = set,
- sub_els = [#unblock{items = JIDs}]}) of
+ sub_els = [#unblock{items = Items}]}) of
#iq{type = result, sub_els = []} ->
- {#iq{id = I1, sub_els = [#unblock{items = Items}]},
+ {#iq{id = I1, sub_els = [#unblock{items = Items1}]},
#iq{id = I2, sub_els = [#privacy_query{lists = Lists}]}} =
?recv2(#iq{type = set, sub_els = [#unblock{}]},
#iq{type = set, sub_els = [#privacy_query{}]}),
send(Config, #iq{type = result, id = I1}),
send(Config, #iq{type = result, id = I2}),
ct:comment("Checking if all JIDs present in the push"),
- true = lists:sort(JIDs) == lists:sort(Items),
+ true = lists:sort(Items) == lists:sort(Items1),
ct:comment("Getting name of the corresponding privacy list"),
[#privacy_list{name = Name}] = Lists,
{ok, Name};