diff --git a/include/xmpp_codec.hrl b/include/xmpp_codec.hrl index 5e11415..1e28246 100644 --- a/include/xmpp_codec.hrl +++ b/include/xmpp_codec.hrl @@ -331,7 +331,7 @@ -record(message_retracted, {id = <<>> :: binary(), by :: undefined | jid:jid(), from = <<>> :: binary(), - stamp :: erlang:timestamp(), + stamp :: undefined | erlang:timestamp(), sub_els = [] :: [xmpp_element() | fxml:xmlel()]}). -type message_retracted() :: #message_retracted{}. @@ -372,9 +372,6 @@ id = <<>> :: binary()}). -type inbox_entry() :: #inbox_entry{}. --record(message_retract, {id = <<>> :: binary()}). --type message_retract() :: #message_retract{}. - -record(x509_challenge_failed, {}). -type x509_challenge_failed() :: #x509_challenge_failed{}. @@ -468,6 +465,11 @@ -record(occupant_id, {id = <<>> :: binary()}). -type occupant_id() :: #occupant_id{}. +-record(message_moderated, {by :: undefined | jid:jid(), + sub_els = [] :: [xmpp_element() | fxml:xmlel()], + occupant_id :: 'undefined' | #occupant_id{}}). +-type message_moderated() :: #message_moderated{}. + -record(hash_used, {algo = <<>> :: binary()}). -type hash_used() :: #hash_used{}. @@ -1139,13 +1141,14 @@ rsm :: 'undefined' | #rsm_set{}}). -type disco_items() :: #disco_items{}. --record(message_moderated, {by :: undefined | jid:jid(), - reason :: 'undefined' | binary(), - retract :: 'undefined' | #message_retract{}, - sub_els = [] :: [xmpp_element() | fxml:xmlel()]}). --type message_moderated() :: #message_moderated{}. +-record(message_retract, {id = <<>> :: binary(), + reason :: 'undefined' | binary(), + moderated :: 'undefined' | #message_moderated{}}). +-type message_retract() :: #message_retract{}. --record(message_moderate, {reason :: 'undefined' | binary(), +-record(message_moderate, {xmlns = <<>> :: binary(), + id = <<>> :: binary(), + reason :: 'undefined' | binary(), retract :: 'undefined' | #message_retract{}}). -type message_moderate() :: #message_moderate{}. diff --git a/src/xep0424.erl b/src/xep0424.erl index 2496bd6..5320a19 100644 --- a/src/xep0424.erl +++ b/src/xep0424.erl @@ -24,18 +24,20 @@ tags() -> [{<<"retracted">>, <<"urn:xmpp:message-retract:1">>}, {<<"retract">>, <<"urn:xmpp:message-retract:1">>}]. -do_encode({message_retract, _} = Retract, TopXMLNS) -> +do_encode({message_retract, _, _, _} = Retract, + TopXMLNS) -> encode_message_retract(Retract, TopXMLNS); do_encode({message_retracted, _, _, _, _, _} = Retracted, TopXMLNS) -> encode_message_retracted(Retracted, TopXMLNS). -do_get_name({message_retract, _}) -> <<"retract">>; +do_get_name({message_retract, _, _, _}) -> + <<"retract">>; do_get_name({message_retracted, _, _, _, _, _}) -> <<"retracted">>. -do_get_ns({message_retract, _}) -> +do_get_ns({message_retract, _, _, _}) -> <<"urn:xmpp:message-retract:1">>; do_get_ns({message_retracted, _, _, _, _, _}) -> <<"urn:xmpp:message-retract:1">>. @@ -52,13 +54,13 @@ set_els({message_retracted, _id, _by, _from, _stamp, _}, _sub_els) -> {message_retracted, _id, _by, _from, _stamp, _sub_els}. -pp(message_retract, 1) -> [id]; +pp(message_retract, 3) -> [id, reason, moderated]; pp(message_retracted, 5) -> [id, by, from, stamp, sub_els]; pp(_, _) -> no. records() -> - [{message_retract, 1}, {message_retracted, 5}]. + [{message_retract, 3}, {message_retracted, 5}]. dec_utc(Val) -> xmpp_util:decode_timestamp(Val). @@ -231,11 +233,7 @@ encode_message_retracted_attr_from(_val, _acc) -> decode_message_retracted_attr_stamp(__TopXMLNS, undefined) -> - erlang:error({xmpp_codec, - {missing_attr, - <<"stamp">>, - <<"retracted">>, - __TopXMLNS}}); + undefined; decode_message_retracted_attr_stamp(__TopXMLNS, _val) -> case catch dec_utc(_val) of {'EXIT', _} -> @@ -247,15 +245,94 @@ decode_message_retracted_attr_stamp(__TopXMLNS, _val) -> _res -> _res end. +encode_message_retracted_attr_stamp(undefined, _acc) -> + _acc; encode_message_retracted_attr_stamp(_val, _acc) -> [{<<"stamp">>, enc_utc(_val)} | _acc]. decode_message_retract(__TopXMLNS, __Opts, {xmlel, <<"retract">>, _attrs, _els}) -> + {Moderated, Reason} = + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + undefined, + undefined), Id = decode_message_retract_attrs(__TopXMLNS, _attrs, undefined), - {message_retract, Id}. + {message_retract, Id, Reason, Moderated}. + +decode_message_retract_els(__TopXMLNS, __Opts, [], + Moderated, Reason) -> + {Moderated, Reason}; +decode_message_retract_els(__TopXMLNS, __Opts, + [{xmlel, <<"reason">>, _attrs, _} = _el | _els], + Moderated, Reason) -> + case xmpp_codec:get_attr(<<"xmlns">>, + _attrs, + __TopXMLNS) + of + <<"urn:xmpp:message-moderate:0">> -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + Moderated, + xep0425:decode_message_moderate_reason(<<"urn:xmpp:message-moderate:0">>, + __Opts, + _el)); + <<"urn:xmpp:message-moderate:1">> -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + Moderated, + xep0425:decode_message_moderate_reason(<<"urn:xmpp:message-moderate:1">>, + __Opts, + _el)); + _ -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + Moderated, + Reason) + end; +decode_message_retract_els(__TopXMLNS, __Opts, + [{xmlel, <<"moderated">>, _attrs, _} = _el | _els], + Moderated, Reason) -> + case xmpp_codec:get_attr(<<"xmlns">>, + _attrs, + __TopXMLNS) + of + <<"urn:xmpp:message-moderate:0">> -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + xep0425:decode_message_moderated(<<"urn:xmpp:message-moderate:0">>, + __Opts, + _el), + Reason); + <<"urn:xmpp:message-moderate:1">> -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + xep0425:decode_message_moderated(<<"urn:xmpp:message-moderate:1">>, + __Opts, + _el), + Reason); + _ -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + Moderated, + Reason) + end; +decode_message_retract_els(__TopXMLNS, __Opts, + [_ | _els], Moderated, Reason) -> + decode_message_retract_els(__TopXMLNS, + __Opts, + _els, + Moderated, + Reason). decode_message_retract_attrs(__TopXMLNS, [{<<"id">>, _val} | _attrs], _Id) -> @@ -266,23 +343,48 @@ decode_message_retract_attrs(__TopXMLNS, [_ | _attrs], decode_message_retract_attrs(__TopXMLNS, [], Id) -> decode_message_retract_attr_id(__TopXMLNS, Id). -encode_message_retract({message_retract, Id}, +encode_message_retract({message_retract, + Id, + Reason, + Moderated}, __TopXMLNS) -> __NewTopXMLNS = xmpp_codec:choose_top_xmlns(<<"urn:xmpp:message-retract:1">>, [], __TopXMLNS), - _els = [], + _els = + lists:reverse('encode_message_retract_$moderated'(Moderated, + __NewTopXMLNS, + 'encode_message_retract_$reason'(Reason, + __NewTopXMLNS, + []))), _attrs = encode_message_retract_attr_id(Id, xmpp_codec:enc_xmlns_attrs(__NewTopXMLNS, __TopXMLNS)), {xmlel, <<"retract">>, _attrs, _els}. +'encode_message_retract_$moderated'(undefined, + __TopXMLNS, _acc) -> + _acc; +'encode_message_retract_$moderated'(Moderated, + __TopXMLNS, _acc) -> + [xep0425:encode_message_moderated(Moderated, __TopXMLNS) + | _acc]. + +'encode_message_retract_$reason'(undefined, __TopXMLNS, + _acc) -> + _acc; +'encode_message_retract_$reason'(Reason, __TopXMLNS, + _acc) -> + [xep0425:encode_message_moderate_reason(Reason, + __TopXMLNS) + | _acc]. + decode_message_retract_attr_id(__TopXMLNS, undefined) -> - erlang:error({xmpp_codec, - {missing_attr, <<"id">>, <<"retract">>, __TopXMLNS}}); + <<>>; decode_message_retract_attr_id(__TopXMLNS, _val) -> _val. +encode_message_retract_attr_id(<<>>, _acc) -> _acc; encode_message_retract_attr_id(_val, _acc) -> [{<<"id">>, _val} | _acc]. diff --git a/src/xep0425.erl b/src/xep0425.erl index 5b4f899..761bd11 100644 --- a/src/xep0425.erl +++ b/src/xep0425.erl @@ -10,16 +10,31 @@ do_decode(<<"reason">>, decode_message_moderate_reason(<<"urn:xmpp:message-moderate:0">>, Opts, El); +do_decode(<<"reason">>, + <<"urn:xmpp:message-moderate:1">>, El, Opts) -> + decode_message_moderate_reason(<<"urn:xmpp:message-moderate:1">>, + Opts, + El); do_decode(<<"moderated">>, <<"urn:xmpp:message-moderate:0">>, El, Opts) -> decode_message_moderated(<<"urn:xmpp:message-moderate:0">>, Opts, El); +do_decode(<<"moderated">>, + <<"urn:xmpp:message-moderate:1">>, El, Opts) -> + decode_message_moderated(<<"urn:xmpp:message-moderate:1">>, + Opts, + El); do_decode(<<"moderate">>, <<"urn:xmpp:message-moderate:0">>, El, Opts) -> decode_message_moderate(<<"urn:xmpp:message-moderate:0">>, Opts, El); +do_decode(<<"moderate">>, + <<"urn:xmpp:message-moderate:1">>, El, Opts) -> + decode_message_moderate(<<"urn:xmpp:message-moderate:1">>, + Opts, + El); do_decode(Name, <<>>, _, _) -> erlang:error({xmpp_codec, {missing_tag_xmlns, Name}}); do_decode(Name, XMLNS, _, _) -> @@ -27,43 +42,44 @@ do_decode(Name, XMLNS, _, _) -> tags() -> [{<<"reason">>, <<"urn:xmpp:message-moderate:0">>}, + {<<"reason">>, <<"urn:xmpp:message-moderate:1">>}, {<<"moderated">>, <<"urn:xmpp:message-moderate:0">>}, - {<<"moderate">>, <<"urn:xmpp:message-moderate:0">>}]. + {<<"moderated">>, <<"urn:xmpp:message-moderate:1">>}, + {<<"moderate">>, <<"urn:xmpp:message-moderate:0">>}, + {<<"moderate">>, <<"urn:xmpp:message-moderate:1">>}]. -do_encode({message_moderate, _, _} = Moderate, +do_encode({message_moderate, _, _, _, _} = Moderate, TopXMLNS) -> encode_message_moderate(Moderate, TopXMLNS); -do_encode({message_moderated, _, _, _, _} = Moderated, +do_encode({message_moderated, _, _, _} = Moderated, TopXMLNS) -> encode_message_moderated(Moderated, TopXMLNS). -do_get_name({message_moderate, _, _}) -> <<"moderate">>; -do_get_name({message_moderated, _, _, _, _}) -> +do_get_name({message_moderate, _, _, _, _}) -> + <<"moderate">>; +do_get_name({message_moderated, _, _, _}) -> <<"moderated">>. -do_get_ns({message_moderate, _, _}) -> - <<"urn:xmpp:message-moderate:0">>; -do_get_ns({message_moderated, _, _, _, _}) -> +do_get_ns({message_moderate, Xmlns, _, _, _}) -> Xmlns; +do_get_ns({message_moderated, _, _, _}) -> <<"urn:xmpp:message-moderate:0">>. get_els({message_moderated, _by, - _reason, - _retract, - _sub_els}) -> + _sub_els, + _occupant_id}) -> _sub_els. -set_els({message_moderated, _by, _reason, _retract, _}, +set_els({message_moderated, _by, _, _occupant_id}, _sub_els) -> - {message_moderated, _by, _reason, _retract, _sub_els}. + {message_moderated, _by, _sub_els, _occupant_id}. -pp(message_moderate, 2) -> [reason, retract]; -pp(message_moderated, 4) -> - [by, reason, retract, sub_els]; +pp(message_moderate, 4) -> [xmlns, id, reason, retract]; +pp(message_moderated, 3) -> [by, sub_els, occupant_id]; pp(_, _) -> no. records() -> - [{message_moderate, 2}, {message_moderated, 4}]. + [{message_moderate, 4}, {message_moderated, 3}]. decode_message_moderate_reason(__TopXMLNS, __Opts, {xmlel, <<"reason">>, _attrs, _els}) -> @@ -90,10 +106,10 @@ decode_message_moderate_reason_els(__TopXMLNS, __Opts, Cdata). encode_message_moderate_reason(Cdata, __TopXMLNS) -> - __NewTopXMLNS = - xmpp_codec:choose_top_xmlns(<<"urn:xmpp:message-moderate:0">>, - [], - __TopXMLNS), + __NewTopXMLNS = xmpp_codec:choose_top_xmlns(<<>>, + [<<"urn:xmpp:message-moderate:0">>, + <<"urn:xmpp:message-moderate:1">>], + __TopXMLNS), _els = encode_message_moderate_reason_cdata(Cdata, []), _attrs = xmpp_codec:enc_xmlns_attrs(__NewTopXMLNS, __TopXMLNS), @@ -113,79 +129,52 @@ encode_message_moderate_reason_cdata(_val, _acc) -> decode_message_moderated(__TopXMLNS, __Opts, {xmlel, <<"moderated">>, _attrs, _els}) -> - {Retract, Reason, __Els} = + {Occupant_id, __Els} = decode_message_moderated_els(__TopXMLNS, __Opts, _els, undefined, - undefined, []), By = decode_message_moderated_attrs(__TopXMLNS, _attrs, undefined), - {message_moderated, By, Reason, Retract, __Els}. + {message_moderated, By, __Els, Occupant_id}. decode_message_moderated_els(__TopXMLNS, __Opts, [], - Retract, Reason, __Els) -> - {Retract, Reason, lists:reverse(__Els)}; + Occupant_id, __Els) -> + {Occupant_id, lists:reverse(__Els)}; decode_message_moderated_els(__TopXMLNS, __Opts, - [{xmlel, <<"reason">>, _attrs, _} = _el | _els], - Retract, Reason, __Els) -> + [{xmlel, <<"occupant-id">>, _attrs, _} = _el + | _els], + Occupant_id, __Els) -> case xmpp_codec:get_attr(<<"xmlns">>, _attrs, __TopXMLNS) of - <<"urn:xmpp:message-moderate:0">> -> + <<"urn:xmpp:occupant-id:0">> -> decode_message_moderated_els(__TopXMLNS, __Opts, _els, - Retract, - decode_message_moderate_reason(<<"urn:xmpp:message-moderate:0">>, - __Opts, - _el), + xep0421:decode_occupant_id(<<"urn:xmpp:occupant-id:0">>, + __Opts, + _el), __Els); _ -> decode_message_moderated_els(__TopXMLNS, __Opts, _els, - Retract, - Reason, + Occupant_id, [_el | __Els]) end; decode_message_moderated_els(__TopXMLNS, __Opts, - [{xmlel, <<"retract">>, _attrs, _} = _el | _els], - Retract, Reason, __Els) -> - case xmpp_codec:get_attr(<<"xmlns">>, - _attrs, - __TopXMLNS) - of - <<"urn:xmpp:message-retract:1">> -> - decode_message_moderated_els(__TopXMLNS, - __Opts, - _els, - xep0424:decode_message_retract(<<"urn:xmpp:message-retract:1">>, - __Opts, - _el), - Reason, - __Els); - _ -> - decode_message_moderated_els(__TopXMLNS, - __Opts, - _els, - Retract, - Reason, - [_el | __Els]) - end; -decode_message_moderated_els(__TopXMLNS, __Opts, - [{xmlel, _name, _attrs, _} = _el | _els], Retract, - Reason, __Els) -> + [{xmlel, _name, _attrs, _} = _el | _els], + Occupant_id, __Els) -> case proplists:get_bool(ignore_els, __Opts) of true -> decode_message_moderated_els(__TopXMLNS, __Opts, _els, - Retract, - Reason, + Occupant_id, [_el | __Els]); false -> __XMLNS = xmpp_codec:get_attr(<<"xmlns">>, @@ -196,15 +185,13 @@ decode_message_moderated_els(__TopXMLNS, __Opts, decode_message_moderated_els(__TopXMLNS, __Opts, _els, - Retract, - Reason, + Occupant_id, [_el | __Els]); Mod -> decode_message_moderated_els(__TopXMLNS, __Opts, _els, - Retract, - Reason, + Occupant_id, [Mod:do_decode(_name, __XMLNS, _el, @@ -213,12 +200,11 @@ decode_message_moderated_els(__TopXMLNS, __Opts, end end; decode_message_moderated_els(__TopXMLNS, __Opts, - [_ | _els], Retract, Reason, __Els) -> + [_ | _els], Occupant_id, __Els) -> decode_message_moderated_els(__TopXMLNS, __Opts, _els, - Retract, - Reason, + Occupant_id, __Els). decode_message_moderated_attrs(__TopXMLNS, @@ -234,41 +220,30 @@ decode_message_moderated_attrs(__TopXMLNS, [], By) -> encode_message_moderated({message_moderated, By, - Reason, - Retract, - __Els}, + __Els, + Occupant_id}, __TopXMLNS) -> - __NewTopXMLNS = - xmpp_codec:choose_top_xmlns(<<"urn:xmpp:message-moderate:0">>, - [], - __TopXMLNS), + __NewTopXMLNS = xmpp_codec:choose_top_xmlns(<<>>, + [<<"urn:xmpp:message-moderate:0">>, + <<"urn:xmpp:message-moderate:1">>], + __TopXMLNS), _els = [xmpp_codec:encode(_el, __NewTopXMLNS) || _el <- __Els] ++ - lists:reverse('encode_message_moderated_$retract'(Retract, - __NewTopXMLNS, - 'encode_message_moderated_$reason'(Reason, - __NewTopXMLNS, - []))), + lists:reverse('encode_message_moderated_$occupant_id'(Occupant_id, + __NewTopXMLNS, + [])), _attrs = encode_message_moderated_attr_by(By, xmpp_codec:enc_xmlns_attrs(__NewTopXMLNS, __TopXMLNS)), {xmlel, <<"moderated">>, _attrs, _els}. -'encode_message_moderated_$retract'(undefined, - __TopXMLNS, _acc) -> - _acc; -'encode_message_moderated_$retract'(Retract, __TopXMLNS, - _acc) -> - [xep0424:encode_message_retract(Retract, __TopXMLNS) - | _acc]. - -'encode_message_moderated_$reason'(undefined, - __TopXMLNS, _acc) -> +'encode_message_moderated_$occupant_id'(undefined, + __TopXMLNS, _acc) -> _acc; -'encode_message_moderated_$reason'(Reason, __TopXMLNS, - _acc) -> - [encode_message_moderate_reason(Reason, __TopXMLNS) +'encode_message_moderated_$occupant_id'(Occupant_id, + __TopXMLNS, _acc) -> + [xep0421:encode_occupant_id(Occupant_id, __TopXMLNS) | _acc]. decode_message_moderated_attr_by(__TopXMLNS, @@ -298,7 +273,11 @@ decode_message_moderate(__TopXMLNS, __Opts, _els, undefined, undefined), - {message_moderate, Reason, Retract}. + {Xmlns, Id} = decode_message_moderate_attrs(__TopXMLNS, + _attrs, + undefined, + undefined), + {message_moderate, Xmlns, Id, Reason, Retract}. decode_message_moderate_els(__TopXMLNS, __Opts, [], Retract, Reason) -> @@ -318,6 +297,14 @@ decode_message_moderate_els(__TopXMLNS, __Opts, decode_message_moderate_reason(<<"urn:xmpp:message-moderate:0">>, __Opts, _el)); + <<"urn:xmpp:message-moderate:1">> -> + decode_message_moderate_els(__TopXMLNS, + __Opts, + _els, + Retract, + decode_message_moderate_reason(<<"urn:xmpp:message-moderate:1">>, + __Opts, + _el)); _ -> decode_message_moderate_els(__TopXMLNS, __Opts, @@ -355,22 +342,48 @@ decode_message_moderate_els(__TopXMLNS, __Opts, Retract, Reason). +decode_message_moderate_attrs(__TopXMLNS, + [{<<"xmlns">>, _val} | _attrs], _Xmlns, Id) -> + decode_message_moderate_attrs(__TopXMLNS, + _attrs, + _val, + Id); +decode_message_moderate_attrs(__TopXMLNS, + [{<<"id">>, _val} | _attrs], Xmlns, _Id) -> + decode_message_moderate_attrs(__TopXMLNS, + _attrs, + Xmlns, + _val); +decode_message_moderate_attrs(__TopXMLNS, [_ | _attrs], + Xmlns, Id) -> + decode_message_moderate_attrs(__TopXMLNS, + _attrs, + Xmlns, + Id); +decode_message_moderate_attrs(__TopXMLNS, [], Xmlns, + Id) -> + {decode_message_moderate_attr_xmlns(__TopXMLNS, Xmlns), + decode_message_moderate_attr_id(__TopXMLNS, Id)}. + encode_message_moderate({message_moderate, + Xmlns, + Id, Reason, Retract}, __TopXMLNS) -> - __NewTopXMLNS = - xmpp_codec:choose_top_xmlns(<<"urn:xmpp:message-moderate:0">>, - [], - __TopXMLNS), + __NewTopXMLNS = xmpp_codec:choose_top_xmlns(Xmlns, + [<<"urn:xmpp:message-moderate:0">>, + <<"urn:xmpp:message-moderate:1">>], + __TopXMLNS), _els = lists:reverse('encode_message_moderate_$retract'(Retract, __NewTopXMLNS, 'encode_message_moderate_$reason'(Reason, __NewTopXMLNS, []))), - _attrs = xmpp_codec:enc_xmlns_attrs(__NewTopXMLNS, - __TopXMLNS), + _attrs = encode_message_moderate_attr_id(Id, + xmpp_codec:enc_xmlns_attrs(__NewTopXMLNS, + __TopXMLNS)), {xmlel, <<"moderate">>, _attrs, _els}. 'encode_message_moderate_$retract'(undefined, @@ -388,3 +401,19 @@ encode_message_moderate({message_moderate, _acc) -> [encode_message_moderate_reason(Reason, __TopXMLNS) | _acc]. + +decode_message_moderate_attr_xmlns(__TopXMLNS, + undefined) -> + <<>>; +decode_message_moderate_attr_xmlns(__TopXMLNS, _val) -> + _val. + +decode_message_moderate_attr_id(__TopXMLNS, + undefined) -> + erlang:error({xmpp_codec, + {missing_attr, <<"id">>, <<"moderate">>, __TopXMLNS}}); +decode_message_moderate_attr_id(__TopXMLNS, _val) -> + _val. + +encode_message_moderate_attr_id(_val, _acc) -> + [{<<"id">>, _val} | _acc]. diff --git a/src/xmpp_codec.erl b/src/xmpp_codec.erl index 90a72a5..3fcf662 100644 --- a/src/xmpp_codec.erl +++ b/src/xmpp_codec.erl @@ -312,11 +312,6 @@ get_mod(<<"actions">>, xep0050; get_mod(<<"continue">>, <<"urn:xmpp:sasl:2">>) -> xep0388; -get_mod(<<"thread">>, <<"jabber:component:accept">>) -> - rfc6120; -get_mod(<<"bad-protocol">>, - <<"urn:ietf:params:xml:ns:xmpp-sasl">>) -> - rfc6120; get_mod(<<"mechanisms">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>) -> rfc6120; @@ -325,8 +320,6 @@ get_mod(<<"query">>, xep0065; get_mod(<<"displayed">>, <<"jabber:x:event">>) -> xep0022; -get_mod(<<"apply-to">>, <<"urn:xmpp:fasten:0">>) -> - xep0422; get_mod(<<"start">>, <<"urn:xmpp:mam:tmp">>) -> xep0313; get_mod(<<"received">>, <<"urn:xmpp:carbons:2">>) -> xep0280; @@ -523,6 +516,9 @@ get_mod(<<"unsupported-transports">>, get_mod(<<"file-not-available">>, <<"urn:xmpp:jingle:apps:file-transfer:errors:0">>) -> xep0234; +get_mod(<<"moderated">>, + <<"urn:xmpp:message-moderate:1">>) -> + xep0425; get_mod(<<"c">>, <<"http://jabber.org/protocol/caps">>) -> xep0115; @@ -779,6 +775,9 @@ get_mod(<<"method">>, get_mod(<<"invalid-jid">>, <<"http://jabber.org/protocol/pubsub#errors">>) -> xep0060; +get_mod(<<"reason">>, + <<"urn:xmpp:message-moderate:1">>) -> + xep0425; get_mod(<<"tag">>, <<"urn:xmpp:bind:0">>) -> xep0386; get_mod(<<"iq">>, <<"jabber:client">>) -> rfc6120; get_mod(<<"LOCALITY">>, <<"vcard-temp">>) -> xep0054; @@ -1151,6 +1150,9 @@ get_mod(<<"stream:error">>, rfc6120; get_mod(<<"mix">>, <<"urn:xmpp:mix:core:1">>) -> xep0369; +get_mod(<<"moderate">>, + <<"urn:xmpp:message-moderate:1">>) -> + xep0425; get_mod(<<"subject">>, <<"jabber:component:accept">>) -> rfc6120; get_mod(<<"text">>, @@ -1709,6 +1711,13 @@ get_mod(<<"nick">>, <<"urn:xmpp:mix:presence:0">>) -> xep0369; get_mod(<<"leave">>, <<"urn:xmpp:mix:core:1">>) -> xep0369; +get_mod(<<"thread">>, <<"jabber:component:accept">>) -> + rfc6120; +get_mod(<<"bad-protocol">>, + <<"urn:ietf:params:xml:ns:xmpp-sasl">>) -> + rfc6120; +get_mod(<<"apply-to">>, <<"urn:xmpp:fasten:0">>) -> + xep0422; get_mod(Name, XMLNS) -> xmpp_codec_external:lookup(Name, XMLNS). @@ -1846,6 +1855,7 @@ get_mod({muc_subscription, _, _, _}) -> p1_mucsub; get_mod({muc_subscribe, _, _, _, _}) -> p1_mucsub; get_mod({feature_csi}) -> xep0352; get_mod({ibb_open, _, _, _}) -> xep0047; +get_mod({message_moderate, _, _, _, _}) -> xep0425; get_mod({sasl2_authenticate, _, _, _, _}) -> xep0388; get_mod({sasl2_continue, _, _, _, _}) -> xep0388; get_mod({vcard_tel, @@ -1905,7 +1915,6 @@ get_mod({mark_displayed, _}) -> xep0333; get_mod({mark_acknowledged, _}) -> xep0333; get_mod({jingle_ft_file, _, _, _, _, _, _, _, _}) -> xep0234; -get_mod({message_retract, _}) -> xep0424; get_mod({bookmark_url, _, _}) -> xep0048; get_mod({gone, _}) -> rfc6120; get_mod({sasl_response, _}) -> rfc6120; @@ -1956,6 +1965,7 @@ get_mod({mix_participant, _, _, _}) -> xep0369; get_mod({db_verify, _, _, _, _, _, _}) -> xep0220; get_mod({upload_slot, _, _, _}) -> xep0363; get_mod({jingle_ibb_transport, _, _, _}) -> xep0261; +get_mod({message_moderated, _, _, _}) -> xep0425; get_mod({muc_decline, _, _, _}) -> xep0045; get_mod({sm_enable, _, _, _}) -> xep0198; get_mod({offline, _, _, _}) -> xep0013; @@ -2000,9 +2010,7 @@ get_mod({mix_create, _, _}) -> xep0369; get_mod({search, _, _, _, _, _, _, _}) -> xep0055; get_mod({expire, _, _}) -> xep0023; get_mod({privilege, _, _}) -> xep0356; -get_mod({message_moderate, _, _}) -> xep0425; get_mod({avatar_pointer, _, _, _, _, _, _}) -> xep0084; -get_mod({message_moderated, _, _, _, _}) -> xep0425; get_mod({muc_invite, _, _, _, _}) -> xep0045; get_mod({mix_client_join, _, _, _}) -> xep0405; get_mod({jingle_reason, _, _, _}) -> xep0166; @@ -2024,6 +2032,7 @@ get_mod({ibb_close, _}) -> xep0047; get_mod({vcard_sound, _, _, _}) -> xep0054; get_mod({ps_retract, _, _, _}) -> xep0060; get_mod({privilege_perm, _, _}) -> xep0356; +get_mod({message_retract, _, _, _}) -> xep0424; get_mod({sasl2_user_agent, _, _, _}) -> xep0388; get_mod({bind2_bind, _, _, _}) -> xep0386; get_mod({vcard_adr,