25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Remove XEP-0091 tags from test suite

This commit is contained in:
Holger Weiss 2015-05-18 14:38:57 +02:00
parent 2af659b737
commit dfbef8be8f
4 changed files with 3 additions and 80 deletions

View File

@ -1286,7 +1286,7 @@ muc_slave(Config) ->
%% Receive the room subject
?recv1(#message{from = PeerNickJID, type = groupchat,
body = [#text{data = Subject}],
sub_els = [#delay{}, #legacy_delay{}]}),
sub_els = [#delay{}]}),
%% Receive MUC history
lists:foreach(
fun(N) ->
@ -1294,7 +1294,7 @@ muc_slave(Config) ->
?recv1(#message{from = PeerNickJID,
type = groupchat,
body = [Text],
sub_els = [#delay{}, #legacy_delay{}]})
sub_els = [#delay{}]})
end, lists:seq(1, 5)),
%% Sending a voice request
VoiceReq = #xdata{
@ -1450,7 +1450,6 @@ offline_slave(Config) ->
body = [#text{data = <<"body">>}],
subject = [#text{data = <<"subject">>}]}),
true = lists:keymember(delay, 1, SubEls),
true = lists:keymember(legacy_delay, 1, SubEls),
disconnect(Config).
carbons_master(Config) ->
@ -1596,7 +1595,7 @@ client_state_slave(Config) ->
change_client_state(Config, inactive),
wait_for_master(Config),
?recv1(#presence{from = Peer, type = unavailable,
sub_els = [#delay{}, #legacy_delay{}]}),
sub_els = [#delay{}]}),
?recv1(#message{from = Peer, thread = <<"1">>,
body = [#text{data = <<"body">>}],
sub_els = [#chatstate{type = active}]}),

View File

@ -166,9 +166,6 @@ decode({xmlel, _name, _attrs, _} = _el, Opts) ->
<<"http://jabber.org/protocol/bytestreams">>} ->
decode_bytestreams_streamhost(<<"http://jabber.org/protocol/bytestreams">>,
IgnoreEls, _el);
{<<"x">>, <<"jabber:x:delay">>} ->
decode_legacy_delay(<<"jabber:x:delay">>, IgnoreEls,
_el);
{<<"delay">>, <<"urn:xmpp:delay">>} ->
decode_delay(<<"urn:xmpp:delay">>, IgnoreEls, _el);
{<<"paused">>,
@ -1109,7 +1106,6 @@ is_known_tag({xmlel, _name, _attrs, _} = _el) ->
{<<"streamhost">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
true;
{<<"x">>, <<"jabber:x:delay">>} -> true;
{<<"delay">>, <<"urn:xmpp:delay">>} -> true;
{<<"paused">>,
<<"http://jabber.org/protocol/chatstates">>} ->
@ -1936,9 +1932,6 @@ encode({chatstate, paused} = Paused) ->
encode({delay, _, _} = Delay) ->
encode_delay(Delay,
[{<<"xmlns">>, <<"urn:xmpp:delay">>}]);
encode({legacy_delay, _, _} = X) ->
encode_legacy_delay(X,
[{<<"xmlns">>, <<"jabber:x:delay">>}]);
encode({streamhost, _, _, _} = Streamhost) ->
encode_bytestreams_streamhost(Streamhost,
[{<<"xmlns">>,
@ -2181,7 +2174,6 @@ get_ns({chatstate, inactive}) ->
get_ns({chatstate, paused}) ->
<<"http://jabber.org/protocol/chatstates">>;
get_ns({delay, _, _}) -> <<"urn:xmpp:delay">>;
get_ns({legacy_delay, _, _}) -> <<"jabber:x:delay">>;
get_ns({streamhost, _, _, _}) ->
<<"http://jabber.org/protocol/bytestreams">>;
get_ns({bytestreams, _, _, _, _, _, _}) ->
@ -2374,7 +2366,6 @@ pp(pubsub, 8) ->
pp(shim, 1) -> [headers];
pp(chatstate, 1) -> [type];
pp(delay, 2) -> [stamp, from];
pp(legacy_delay, 2) -> [stamp, from];
pp(streamhost, 3) -> [jid, host, port];
pp(bytestreams, 6) ->
[hosts, used, activate, dstaddr, mode, sid];
@ -5397,60 +5388,6 @@ encode_bytestreams_streamhost_attr_port(1080, _acc) ->
encode_bytestreams_streamhost_attr_port(_val, _acc) ->
[{<<"port">>, enc_int(_val)} | _acc].
decode_legacy_delay(__TopXMLNS, __IgnoreEls,
{xmlel, <<"x">>, _attrs, _els}) ->
{Stamp, From} = decode_legacy_delay_attrs(__TopXMLNS,
_attrs, undefined, undefined),
{legacy_delay, Stamp, From}.
decode_legacy_delay_attrs(__TopXMLNS,
[{<<"stamp">>, _val} | _attrs], _Stamp, From) ->
decode_legacy_delay_attrs(__TopXMLNS, _attrs, _val,
From);
decode_legacy_delay_attrs(__TopXMLNS,
[{<<"from">>, _val} | _attrs], Stamp, _From) ->
decode_legacy_delay_attrs(__TopXMLNS, _attrs, Stamp,
_val);
decode_legacy_delay_attrs(__TopXMLNS, [_ | _attrs],
Stamp, From) ->
decode_legacy_delay_attrs(__TopXMLNS, _attrs, Stamp,
From);
decode_legacy_delay_attrs(__TopXMLNS, [], Stamp,
From) ->
{decode_legacy_delay_attr_stamp(__TopXMLNS, Stamp),
decode_legacy_delay_attr_from(__TopXMLNS, From)}.
encode_legacy_delay({legacy_delay, Stamp, From},
_xmlns_attrs) ->
_els = [],
_attrs = encode_legacy_delay_attr_from(From,
encode_legacy_delay_attr_stamp(Stamp,
_xmlns_attrs)),
{xmlel, <<"x">>, _attrs, _els}.
decode_legacy_delay_attr_stamp(__TopXMLNS, undefined) ->
erlang:error({xmpp_codec,
{missing_attr, <<"stamp">>, <<"x">>, __TopXMLNS}});
decode_legacy_delay_attr_stamp(__TopXMLNS, _val) ->
_val.
encode_legacy_delay_attr_stamp(_val, _acc) ->
[{<<"stamp">>, _val} | _acc].
decode_legacy_delay_attr_from(__TopXMLNS, undefined) ->
undefined;
decode_legacy_delay_attr_from(__TopXMLNS, _val) ->
case catch dec_jid(_val) of
{'EXIT', _} ->
erlang:error({xmpp_codec,
{bad_attr_value, <<"from">>, <<"x">>, __TopXMLNS}});
_res -> _res
end.
encode_legacy_delay_attr_from(undefined, _acc) -> _acc;
encode_legacy_delay_attr_from(_val, _acc) ->
[{<<"from">>, enc_jid(_val)} | _acc].
decode_delay(__TopXMLNS, __IgnoreEls,
{xmlel, <<"delay">>, _attrs, _els}) ->
{Stamp, From} = decode_delay_attrs(__TopXMLNS, _attrs,

View File

@ -137,9 +137,6 @@
-record(feature_csi, {xmlns :: binary()}).
-record(legacy_delay, {stamp :: binary(),
from :: any()}).
-record(muc_user_destroy, {reason :: binary(),
jid :: any()}).

View File

@ -1808,16 +1808,6 @@
dec = {dec_jid, []},
enc = {enc_jid, []}}]}).
-xml(legacy_delay,
#elem{name = <<"x">>,
xmlns = <<"jabber:x:delay">>,
result = {legacy_delay, '$stamp', '$from'},
attrs = [#attr{name = <<"stamp">>,
required = true},
#attr{name = <<"from">>,
dec = {dec_jid, []},
enc = {enc_jid, []}}]}).
-xml(bytestreams_streamhost,
#elem{name = <<"streamhost">>,
xmlns = <<"http://jabber.org/protocol/bytestreams">>,