xmpp.chapril.org-ejabberd/tools/xmpp_codec.erl

15147 lines
510 KiB
Erlang

%% Created automatically by XML generator (xml_gen.erl)
%% Source: xmpp_codec.spec
-module(xmpp_codec).
-compile({nowarn_unused_function,
[{dec_int, 3}, {dec_int, 1}, {dec_enum, 2},
{enc_int, 1}, {get_attr, 2}, {enc_enum, 1}]}).
-export([pp/1, format_error/1, decode/1, is_known_tag/1,
encode/1]).
decode({xmlel, _name, _attrs, _} = _el) ->
case {_name, get_attr(<<"xmlns">>, _attrs)} of
{<<"sent">>, <<"urn:xmpp:carbons:2">>} ->
decode_carbons_sent(_el);
{<<"received">>, <<"urn:xmpp:carbons:2">>} ->
decode_carbons_received(_el);
{<<"private">>, <<"urn:xmpp:carbons:2">>} ->
decode_carbons_private(_el);
{<<"enable">>, <<"urn:xmpp:carbons:2">>} ->
decode_carbons_enable(_el);
{<<"disable">>, <<"urn:xmpp:carbons:2">>} ->
decode_carbons_disable(_el);
{<<"forwarded">>, <<"urn:xmpp:forward:0">>} ->
decode_forwarded(_el);
{<<"x">>, <<"http://jabber.org/protocol/muc">>} ->
decode_muc(_el);
{<<"query">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
decode_muc_admin(_el);
{<<"reason">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
decode_muc_admin_reason(_el);
{<<"continue">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
decode_muc_admin_continue(_el);
{<<"actor">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
decode_muc_admin_actor(_el);
{<<"item">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
decode_muc_admin_item(_el);
{<<"query">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
decode_muc_owner(_el);
{<<"destroy">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
decode_muc_owner_destroy(_el);
{<<"reason">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
decode_muc_owner_reason(_el);
{<<"password">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
decode_muc_owner_password(_el);
{<<"x">>, <<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user(_el);
{<<"item">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_item(_el);
{<<"status">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_status(_el);
{<<"continue">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_continue(_el);
{<<"actor">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_actor(_el);
{<<"invite">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_invite(_el);
{<<"destroy">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_destroy(_el);
{<<"decline">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_decline(_el);
{<<"reason">>,
<<"http://jabber.org/protocol/muc#user">>} ->
decode_muc_user_reason(_el);
{<<"history">>, <<"http://jabber.org/protocol/muc">>} ->
decode_muc_history(_el);
{<<"query">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
decode_bytestreams(_el);
{<<"activate">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
decode_bytestreams_activate(_el);
{<<"streamhost-used">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
decode_bytestreams_streamhost_used(_el);
{<<"streamhost">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
decode_bytestreams_streamhost(_el);
{<<"x">>, <<"jabber:x:delay">>} ->
decode_legacy_delay(_el);
{<<"delay">>, <<"urn:xmpp:delay">>} ->
decode_delay(_el);
{<<"headers">>,
<<"http://jabber.org/protocol/shim">>} ->
decode_shim_headers(_el);
{<<"header">>, <<"http://jabber.org/protocol/shim">>} ->
decode_shim_header(_el);
{<<"pubsub">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub(_el);
{<<"retract">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_retract(_el);
{<<"options">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_options(_el);
{<<"publish">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_publish(_el);
{<<"unsubscribe">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_unsubscribe(_el);
{<<"subscribe">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_subscribe(_el);
{<<"affiliations">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_affiliations(_el);
{<<"subscriptions">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_subscriptions(_el);
{<<"event">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
decode_pubsub_event(_el);
{<<"items">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
decode_pubsub_event_items(_el);
{<<"item">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
decode_pubsub_event_item(_el);
{<<"retract">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
decode_pubsub_event_retract(_el);
{<<"items">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_items(_el);
{<<"item">>, <<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_item(_el);
{<<"affiliation">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_affiliation(_el);
{<<"subscription">>,
<<"http://jabber.org/protocol/pubsub">>} ->
decode_pubsub_subscription(_el);
{<<"x">>, <<"jabber:x:data">>} -> decode_xdata(_el);
{<<"item">>, <<"jabber:x:data">>} ->
decode_xdata_item(_el);
{<<"reported">>, <<"jabber:x:data">>} ->
decode_xdata_reported(_el);
{<<"title">>, <<"jabber:x:data">>} ->
decode_xdata_title(_el);
{<<"instructions">>, <<"jabber:x:data">>} ->
decode_xdata_instructions(_el);
{<<"field">>, <<"jabber:x:data">>} ->
decode_xdata_field(_el);
{<<"option">>, <<"jabber:x:data">>} ->
decode_xdata_field_option(_el);
{<<"value">>, <<"jabber:x:data">>} ->
decode_xdata_field_value(_el);
{<<"desc">>, <<"jabber:x:data">>} ->
decode_xdata_field_desc(_el);
{<<"required">>, <<"jabber:x:data">>} ->
decode_xdata_field_required(_el);
{<<"vCard">>, <<"vcard-temp">>} -> decode_vcard(_el);
{<<"CLASS">>, <<"vcard-temp">>} ->
decode_vcard_CLASS(_el);
{<<"CATEGORIES">>, <<"vcard-temp">>} ->
decode_vcard_CATEGORIES(_el);
{<<"KEY">>, <<"vcard-temp">>} -> decode_vcard_KEY(_el);
{<<"SOUND">>, <<"vcard-temp">>} ->
decode_vcard_SOUND(_el);
{<<"ORG">>, <<"vcard-temp">>} -> decode_vcard_ORG(_el);
{<<"PHOTO">>, <<"vcard-temp">>} ->
decode_vcard_PHOTO(_el);
{<<"LOGO">>, <<"vcard-temp">>} ->
decode_vcard_LOGO(_el);
{<<"BINVAL">>, <<"vcard-temp">>} ->
decode_vcard_BINVAL(_el);
{<<"GEO">>, <<"vcard-temp">>} -> decode_vcard_GEO(_el);
{<<"EMAIL">>, <<"vcard-temp">>} ->
decode_vcard_EMAIL(_el);
{<<"TEL">>, <<"vcard-temp">>} -> decode_vcard_TEL(_el);
{<<"LABEL">>, <<"vcard-temp">>} ->
decode_vcard_LABEL(_el);
{<<"ADR">>, <<"vcard-temp">>} -> decode_vcard_ADR(_el);
{<<"N">>, <<"vcard-temp">>} -> decode_vcard_N(_el);
{<<"CONFIDENTIAL">>, <<"vcard-temp">>} ->
decode_vcard_CONFIDENTIAL(_el);
{<<"PRIVATE">>, <<"vcard-temp">>} ->
decode_vcard_PRIVATE(_el);
{<<"PUBLIC">>, <<"vcard-temp">>} ->
decode_vcard_PUBLIC(_el);
{<<"EXTVAL">>, <<"vcard-temp">>} ->
decode_vcard_EXTVAL(_el);
{<<"TYPE">>, <<"vcard-temp">>} ->
decode_vcard_TYPE(_el);
{<<"DESC">>, <<"vcard-temp">>} ->
decode_vcard_DESC(_el);
{<<"URL">>, <<"vcard-temp">>} -> decode_vcard_URL(_el);
{<<"UID">>, <<"vcard-temp">>} -> decode_vcard_UID(_el);
{<<"SORT-STRING">>, <<"vcard-temp">>} ->
decode_vcard_SORT_STRING(_el);
{<<"REV">>, <<"vcard-temp">>} -> decode_vcard_REV(_el);
{<<"PRODID">>, <<"vcard-temp">>} ->
decode_vcard_PRODID(_el);
{<<"NOTE">>, <<"vcard-temp">>} ->
decode_vcard_NOTE(_el);
{<<"KEYWORD">>, <<"vcard-temp">>} ->
decode_vcard_KEYWORD(_el);
{<<"ROLE">>, <<"vcard-temp">>} ->
decode_vcard_ROLE(_el);
{<<"TITLE">>, <<"vcard-temp">>} ->
decode_vcard_TITLE(_el);
{<<"TZ">>, <<"vcard-temp">>} -> decode_vcard_TZ(_el);
{<<"MAILER">>, <<"vcard-temp">>} ->
decode_vcard_MAILER(_el);
{<<"JABBERID">>, <<"vcard-temp">>} ->
decode_vcard_JABBERID(_el);
{<<"BDAY">>, <<"vcard-temp">>} ->
decode_vcard_BDAY(_el);
{<<"NICKNAME">>, <<"vcard-temp">>} ->
decode_vcard_NICKNAME(_el);
{<<"FN">>, <<"vcard-temp">>} -> decode_vcard_FN(_el);
{<<"VERSION">>, <<"vcard-temp">>} ->
decode_vcard_VERSION(_el);
{<<"CRED">>, <<"vcard-temp">>} ->
decode_vcard_CRED(_el);
{<<"PHONETIC">>, <<"vcard-temp">>} ->
decode_vcard_PHONETIC(_el);
{<<"ORGUNIT">>, <<"vcard-temp">>} ->
decode_vcard_ORGUNIT(_el);
{<<"ORGNAME">>, <<"vcard-temp">>} ->
decode_vcard_ORGNAME(_el);
{<<"LON">>, <<"vcard-temp">>} -> decode_vcard_LON(_el);
{<<"LAT">>, <<"vcard-temp">>} -> decode_vcard_LAT(_el);
{<<"USERID">>, <<"vcard-temp">>} ->
decode_vcard_USERID(_el);
{<<"NUMBER">>, <<"vcard-temp">>} ->
decode_vcard_NUMBER(_el);
{<<"LINE">>, <<"vcard-temp">>} ->
decode_vcard_LINE(_el);
{<<"CTRY">>, <<"vcard-temp">>} ->
decode_vcard_CTRY(_el);
{<<"PCODE">>, <<"vcard-temp">>} ->
decode_vcard_PCODE(_el);
{<<"REGION">>, <<"vcard-temp">>} ->
decode_vcard_REGION(_el);
{<<"LOCALITY">>, <<"vcard-temp">>} ->
decode_vcard_LOCALITY(_el);
{<<"STREET">>, <<"vcard-temp">>} ->
decode_vcard_STREET(_el);
{<<"EXTADD">>, <<"vcard-temp">>} ->
decode_vcard_EXTADD(_el);
{<<"POBOX">>, <<"vcard-temp">>} ->
decode_vcard_POBOX(_el);
{<<"SUFFIX">>, <<"vcard-temp">>} ->
decode_vcard_SUFFIX(_el);
{<<"PREFIX">>, <<"vcard-temp">>} ->
decode_vcard_PREFIX(_el);
{<<"MIDDLE">>, <<"vcard-temp">>} ->
decode_vcard_MIDDLE(_el);
{<<"GIVEN">>, <<"vcard-temp">>} ->
decode_vcard_GIVEN(_el);
{<<"FAMILY">>, <<"vcard-temp">>} ->
decode_vcard_FAMILY(_el);
{<<"X400">>, <<"vcard-temp">>} ->
decode_vcard_X400(_el);
{<<"INTERNET">>, <<"vcard-temp">>} ->
decode_vcard_INTERNET(_el);
{<<"PREF">>, <<"vcard-temp">>} ->
decode_vcard_PREF(_el);
{<<"INTL">>, <<"vcard-temp">>} ->
decode_vcard_INTL(_el);
{<<"DOM">>, <<"vcard-temp">>} -> decode_vcard_DOM(_el);
{<<"PARCEL">>, <<"vcard-temp">>} ->
decode_vcard_PARCEL(_el);
{<<"POSTAL">>, <<"vcard-temp">>} ->
decode_vcard_POSTAL(_el);
{<<"PCS">>, <<"vcard-temp">>} -> decode_vcard_PCS(_el);
{<<"ISDN">>, <<"vcard-temp">>} ->
decode_vcard_ISDN(_el);
{<<"MODEM">>, <<"vcard-temp">>} ->
decode_vcard_MODEM(_el);
{<<"BBS">>, <<"vcard-temp">>} -> decode_vcard_BBS(_el);
{<<"VIDEO">>, <<"vcard-temp">>} ->
decode_vcard_VIDEO(_el);
{<<"CELL">>, <<"vcard-temp">>} ->
decode_vcard_CELL(_el);
{<<"MSG">>, <<"vcard-temp">>} -> decode_vcard_MSG(_el);
{<<"PAGER">>, <<"vcard-temp">>} ->
decode_vcard_PAGER(_el);
{<<"FAX">>, <<"vcard-temp">>} -> decode_vcard_FAX(_el);
{<<"VOICE">>, <<"vcard-temp">>} ->
decode_vcard_VOICE(_el);
{<<"WORK">>, <<"vcard-temp">>} ->
decode_vcard_WORK(_el);
{<<"HOME">>, <<"vcard-temp">>} ->
decode_vcard_HOME(_el);
{<<"stream:error">>,
<<"http://etherx.jabber.org/streams">>} ->
decode_stream_error(_el);
{<<"unsupported-version">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_unsupported_version(_el);
{<<"unsupported-stanza-type">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_unsupported_stanza_type(_el);
{<<"unsupported-encoding">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_unsupported_encoding(_el);
{<<"undefined-condition">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_undefined_condition(_el);
{<<"system-shutdown">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_system_shutdown(_el);
{<<"see-other-host">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_see_other_host(_el);
{<<"restricted-xml">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_restricted_xml(_el);
{<<"resource-constraint">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_resource_constraint(_el);
{<<"reset">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_reset(_el);
{<<"remote-connection-failed">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_remote_connection_failed(_el);
{<<"policy-violation">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_policy_violation(_el);
{<<"not-well-formed">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_not_well_formed(_el);
{<<"not-authorized">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_not_authorized(_el);
{<<"invalid-xml">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_invalid_xml(_el);
{<<"invalid-namespace">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_invalid_namespace(_el);
{<<"invalid-id">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_invalid_id(_el);
{<<"invalid-from">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_invalid_from(_el);
{<<"internal-server-error">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_internal_server_error(_el);
{<<"improper-addressing">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_improper_addressing(_el);
{<<"host-unknown">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_host_unknown(_el);
{<<"host-gone">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_host_gone(_el);
{<<"connection-timeout">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_connection_timeout(_el);
{<<"conflict">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_conflict(_el);
{<<"bad-namespace-prefix">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_bad_namespace_prefix(_el);
{<<"bad-format">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_bad_format(_el);
{<<"text">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
decode_stream_error_text(_el);
{<<"time">>, <<"urn:xmpp:time">>} -> decode_time(_el);
{<<"tzo">>, <<"urn:xmpp:time">>} ->
decode_time_tzo(_el);
{<<"utc">>, <<"urn:xmpp:time">>} ->
decode_time_utc(_el);
{<<"ping">>, <<"urn:xmpp:ping">>} -> decode_ping(_el);
{<<"session">>,
<<"urn:ietf:params:xml:ns:xmpp-session">>} ->
decode_session(_el);
{<<"query">>, <<"jabber:iq:register">>} ->
decode_register(_el);
{<<"key">>, <<"jabber:iq:register">>} ->
decode_register_key(_el);
{<<"text">>, <<"jabber:iq:register">>} ->
decode_register_text(_el);
{<<"misc">>, <<"jabber:iq:register">>} ->
decode_register_misc(_el);
{<<"date">>, <<"jabber:iq:register">>} ->
decode_register_date(_el);
{<<"url">>, <<"jabber:iq:register">>} ->
decode_register_url(_el);
{<<"phone">>, <<"jabber:iq:register">>} ->
decode_register_phone(_el);
{<<"zip">>, <<"jabber:iq:register">>} ->
decode_register_zip(_el);
{<<"state">>, <<"jabber:iq:register">>} ->
decode_register_state(_el);
{<<"city">>, <<"jabber:iq:register">>} ->
decode_register_city(_el);
{<<"address">>, <<"jabber:iq:register">>} ->
decode_register_address(_el);
{<<"email">>, <<"jabber:iq:register">>} ->
decode_register_email(_el);
{<<"last">>, <<"jabber:iq:register">>} ->
decode_register_last(_el);
{<<"first">>, <<"jabber:iq:register">>} ->
decode_register_first(_el);
{<<"name">>, <<"jabber:iq:register">>} ->
decode_register_name(_el);
{<<"password">>, <<"jabber:iq:register">>} ->
decode_register_password(_el);
{<<"nick">>, <<"jabber:iq:register">>} ->
decode_register_nick(_el);
{<<"username">>, <<"jabber:iq:register">>} ->
decode_register_username(_el);
{<<"instructions">>, <<"jabber:iq:register">>} ->
decode_register_instructions(_el);
{<<"remove">>, <<"jabber:iq:register">>} ->
decode_register_remove(_el);
{<<"registered">>, <<"jabber:iq:register">>} ->
decode_register_registered(_el);
{<<"register">>,
<<"http://jabber.org/features/iq-register">>} ->
decode_feature_register(_el);
{<<"c">>, <<"http://jabber.org/protocol/caps">>} ->
decode_caps(_el);
{<<"ack">>, <<"p1:ack">>} -> decode_p1_ack(_el);
{<<"rebind">>, <<"p1:rebind">>} ->
decode_p1_rebind(_el);
{<<"push">>, <<"p1:push">>} -> decode_p1_push(_el);
{<<"stream:features">>,
<<"http://etherx.jabber.org/streams">>} ->
decode_stream_features(_el);
{<<"compression">>,
<<"http://jabber.org/features/compress">>} ->
decode_compression(_el);
{<<"method">>,
<<"http://jabber.org/features/compress">>} ->
decode_compression_method(_el);
{<<"compressed">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compressed(_el);
{<<"compress">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compress(_el);
{<<"method">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compress_method(_el);
{<<"failure">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compress_failure(_el);
{<<"unsupported-method">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compress_failure_unsupported_method(_el);
{<<"processing-failed">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compress_failure_processing_failed(_el);
{<<"setup-failed">>,
<<"http://jabber.org/protocol/compress">>} ->
decode_compress_failure_setup_failed(_el);
{<<"failure">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
decode_starttls_failure(_el);
{<<"proceed">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
decode_starttls_proceed(_el);
{<<"starttls">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
decode_starttls(_el);
{<<"required">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
decode_starttls_required(_el);
{<<"mechanisms">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_mechanisms(_el);
{<<"mechanism">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_mechanism(_el);
{<<"failure">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure(_el);
{<<"temporary-auth-failure">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_temporary_auth_failure(_el);
{<<"not-authorized">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_not_authorized(_el);
{<<"mechanism-too-weak">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_mechanism_too_weak(_el);
{<<"malformed-request">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_malformed_request(_el);
{<<"invalid-mechanism">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_invalid_mechanism(_el);
{<<"invalid-authzid">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_invalid_authzid(_el);
{<<"incorrect-encoding">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_incorrect_encoding(_el);
{<<"encryption-required">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_encryption_required(_el);
{<<"credentials-expired">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_credentials_expired(_el);
{<<"account-disabled">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_account_disabled(_el);
{<<"aborted">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_aborted(_el);
{<<"text">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_failure_text(_el);
{<<"success">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_success(_el);
{<<"response">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_response(_el);
{<<"challenge">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_challenge(_el);
{<<"abort">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_abort(_el);
{<<"auth">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
decode_sasl_auth(_el);
{<<"bind">>, <<"urn:ietf:params:xml:ns:xmpp-bind">>} ->
decode_bind(_el);
{<<"resource">>,
<<"urn:ietf:params:xml:ns:xmpp-bind">>} ->
decode_bind_resource(_el);
{<<"jid">>, <<"urn:ietf:params:xml:ns:xmpp-bind">>} ->
decode_bind_jid(_el);
{<<"error">>, <<"jabber:client">>} -> decode_error(_el);
{<<"text">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_text(_el);
{<<"unexpected-request">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_unexpected_request(_el);
{<<"undefined-condition">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_undefined_condition(_el);
{<<"subscription-required">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_subscription_required(_el);
{<<"service-unavailable">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_service_unavailable(_el);
{<<"resource-constraint">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_resource_constraint(_el);
{<<"remote-server-timeout">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_remote_server_timeout(_el);
{<<"remote-server-not-found">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_remote_server_not_found(_el);
{<<"registration-required">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_registration_required(_el);
{<<"redirect">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_redirect(_el);
{<<"recipient-unavailable">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_recipient_unavailable(_el);
{<<"policy-violation">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_policy_violation(_el);
{<<"not-authorized">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_not_authorized(_el);
{<<"not-allowed">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_not_allowed(_el);
{<<"not-acceptable">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_not_acceptable(_el);
{<<"jid-malformed">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_jid_malformed(_el);
{<<"item-not-found">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_item_not_found(_el);
{<<"internal-server-error">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_internal_server_error(_el);
{<<"gone">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_gone(_el);
{<<"forbidden">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_forbidden(_el);
{<<"feature-not-implemented">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_feature_not_implemented(_el);
{<<"conflict">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_conflict(_el);
{<<"bad-request">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
decode_error_bad_request(_el);
{<<"presence">>, <<"jabber:client">>} ->
decode_presence(_el);
{<<"priority">>, <<"jabber:client">>} ->
decode_presence_priority(_el);
{<<"status">>, <<"jabber:client">>} ->
decode_presence_status(_el);
{<<"show">>, <<"jabber:client">>} ->
decode_presence_show(_el);
{<<"message">>, <<"jabber:client">>} ->
decode_message(_el);
{<<"thread">>, <<"jabber:client">>} ->
decode_message_thread(_el);
{<<"body">>, <<"jabber:client">>} ->
decode_message_body(_el);
{<<"subject">>, <<"jabber:client">>} ->
decode_message_subject(_el);
{<<"iq">>, <<"jabber:client">>} -> decode_iq(_el);
{<<"query">>, <<"http://jabber.org/protocol/stats">>} ->
decode_stats(_el);
{<<"stat">>, <<"http://jabber.org/protocol/stats">>} ->
decode_stat(_el);
{<<"error">>, <<"http://jabber.org/protocol/stats">>} ->
decode_stat_error(_el);
{<<"storage">>, <<"storage:bookmarks">>} ->
decode_bookmarks_storage(_el);
{<<"url">>, <<"storage:bookmarks">>} ->
decode_bookmark_url(_el);
{<<"conference">>, <<"storage:bookmarks">>} ->
decode_bookmark_conference(_el);
{<<"password">>, <<"storage:bookmarks">>} ->
decode_conference_password(_el);
{<<"nick">>, <<"storage:bookmarks">>} ->
decode_conference_nick(_el);
{<<"query">>, <<"jabber:iq:private">>} ->
decode_private(_el);
{<<"query">>,
<<"http://jabber.org/protocol/disco#items">>} ->
decode_disco_items(_el);
{<<"item">>,
<<"http://jabber.org/protocol/disco#items">>} ->
decode_disco_item(_el);
{<<"query">>,
<<"http://jabber.org/protocol/disco#info">>} ->
decode_disco_info(_el);
{<<"feature">>,
<<"http://jabber.org/protocol/disco#info">>} ->
decode_disco_feature(_el);
{<<"identity">>,
<<"http://jabber.org/protocol/disco#info">>} ->
decode_disco_identity(_el);
{<<"blocklist">>, <<"urn:xmpp:blocking">>} ->
decode_block_list(_el);
{<<"unblock">>, <<"urn:xmpp:blocking">>} ->
decode_unblock(_el);
{<<"block">>, <<"urn:xmpp:blocking">>} ->
decode_block(_el);
{<<"item">>, <<"urn:xmpp:blocking">>} ->
decode_block_item(_el);
{<<"query">>, <<"jabber:iq:privacy">>} ->
decode_privacy(_el);
{<<"active">>, <<"jabber:iq:privacy">>} ->
decode_privacy_active_list(_el);
{<<"default">>, <<"jabber:iq:privacy">>} ->
decode_privacy_default_list(_el);
{<<"list">>, <<"jabber:iq:privacy">>} ->
decode_privacy_list(_el);
{<<"item">>, <<"jabber:iq:privacy">>} ->
decode_privacy_item(_el);
{<<"presence-out">>, <<"jabber:iq:privacy">>} ->
decode_privacy_presence_out(_el);
{<<"presence-in">>, <<"jabber:iq:privacy">>} ->
decode_privacy_presence_in(_el);
{<<"iq">>, <<"jabber:iq:privacy">>} ->
decode_privacy_iq(_el);
{<<"message">>, <<"jabber:iq:privacy">>} ->
decode_privacy_message(_el);
{<<"query">>, <<"jabber:iq:roster">>} ->
decode_roster(_el);
{<<"item">>, <<"jabber:iq:roster">>} ->
decode_roster_item(_el);
{<<"group">>, <<"jabber:iq:roster">>} ->
decode_roster_group(_el);
{<<"query">>, <<"jabber:iq:version">>} ->
decode_version(_el);
{<<"os">>, <<"jabber:iq:version">>} ->
decode_version_os(_el);
{<<"version">>, <<"jabber:iq:version">>} ->
decode_version_ver(_el);
{<<"name">>, <<"jabber:iq:version">>} ->
decode_version_name(_el);
{<<"query">>, <<"jabber:iq:last">>} -> decode_last(_el);
{_name, _xmlns} ->
erlang:error({xmpp_codec, {unknown_tag, _name, _xmlns}})
end.
is_known_tag({xmlel, _name, _attrs, _} = _el) ->
case {_name, get_attr(<<"xmlns">>, _attrs)} of
{<<"sent">>, <<"urn:xmpp:carbons:2">>} -> true;
{<<"received">>, <<"urn:xmpp:carbons:2">>} -> true;
{<<"private">>, <<"urn:xmpp:carbons:2">>} -> true;
{<<"enable">>, <<"urn:xmpp:carbons:2">>} -> true;
{<<"disable">>, <<"urn:xmpp:carbons:2">>} -> true;
{<<"forwarded">>, <<"urn:xmpp:forward:0">>} -> true;
{<<"x">>, <<"http://jabber.org/protocol/muc">>} -> true;
{<<"query">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
true;
{<<"reason">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
true;
{<<"continue">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
true;
{<<"actor">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
true;
{<<"item">>,
<<"http://jabber.org/protocol/muc#admin">>} ->
true;
{<<"query">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
true;
{<<"destroy">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
true;
{<<"reason">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
true;
{<<"password">>,
<<"http://jabber.org/protocol/muc#owner">>} ->
true;
{<<"x">>, <<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"item">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"status">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"continue">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"actor">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"invite">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"destroy">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"decline">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"reason">>,
<<"http://jabber.org/protocol/muc#user">>} ->
true;
{<<"history">>, <<"http://jabber.org/protocol/muc">>} ->
true;
{<<"query">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
true;
{<<"activate">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
true;
{<<"streamhost-used">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
true;
{<<"streamhost">>,
<<"http://jabber.org/protocol/bytestreams">>} ->
true;
{<<"x">>, <<"jabber:x:delay">>} -> true;
{<<"delay">>, <<"urn:xmpp:delay">>} -> true;
{<<"headers">>,
<<"http://jabber.org/protocol/shim">>} ->
true;
{<<"header">>, <<"http://jabber.org/protocol/shim">>} ->
true;
{<<"pubsub">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"retract">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"options">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"publish">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"unsubscribe">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"subscribe">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"affiliations">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"subscriptions">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"event">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
true;
{<<"items">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
true;
{<<"item">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
true;
{<<"retract">>,
<<"http://jabber.org/protocol/pubsub#event">>} ->
true;
{<<"items">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"item">>, <<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"affiliation">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"subscription">>,
<<"http://jabber.org/protocol/pubsub">>} ->
true;
{<<"x">>, <<"jabber:x:data">>} -> true;
{<<"item">>, <<"jabber:x:data">>} -> true;
{<<"reported">>, <<"jabber:x:data">>} -> true;
{<<"title">>, <<"jabber:x:data">>} -> true;
{<<"instructions">>, <<"jabber:x:data">>} -> true;
{<<"field">>, <<"jabber:x:data">>} -> true;
{<<"option">>, <<"jabber:x:data">>} -> true;
{<<"value">>, <<"jabber:x:data">>} -> true;
{<<"desc">>, <<"jabber:x:data">>} -> true;
{<<"required">>, <<"jabber:x:data">>} -> true;
{<<"vCard">>, <<"vcard-temp">>} -> true;
{<<"CLASS">>, <<"vcard-temp">>} -> true;
{<<"CATEGORIES">>, <<"vcard-temp">>} -> true;
{<<"KEY">>, <<"vcard-temp">>} -> true;
{<<"SOUND">>, <<"vcard-temp">>} -> true;
{<<"ORG">>, <<"vcard-temp">>} -> true;
{<<"PHOTO">>, <<"vcard-temp">>} -> true;
{<<"LOGO">>, <<"vcard-temp">>} -> true;
{<<"BINVAL">>, <<"vcard-temp">>} -> true;
{<<"GEO">>, <<"vcard-temp">>} -> true;
{<<"EMAIL">>, <<"vcard-temp">>} -> true;
{<<"TEL">>, <<"vcard-temp">>} -> true;
{<<"LABEL">>, <<"vcard-temp">>} -> true;
{<<"ADR">>, <<"vcard-temp">>} -> true;
{<<"N">>, <<"vcard-temp">>} -> true;
{<<"CONFIDENTIAL">>, <<"vcard-temp">>} -> true;
{<<"PRIVATE">>, <<"vcard-temp">>} -> true;
{<<"PUBLIC">>, <<"vcard-temp">>} -> true;
{<<"EXTVAL">>, <<"vcard-temp">>} -> true;
{<<"TYPE">>, <<"vcard-temp">>} -> true;
{<<"DESC">>, <<"vcard-temp">>} -> true;
{<<"URL">>, <<"vcard-temp">>} -> true;
{<<"UID">>, <<"vcard-temp">>} -> true;
{<<"SORT-STRING">>, <<"vcard-temp">>} -> true;
{<<"REV">>, <<"vcard-temp">>} -> true;
{<<"PRODID">>, <<"vcard-temp">>} -> true;
{<<"NOTE">>, <<"vcard-temp">>} -> true;
{<<"KEYWORD">>, <<"vcard-temp">>} -> true;
{<<"ROLE">>, <<"vcard-temp">>} -> true;
{<<"TITLE">>, <<"vcard-temp">>} -> true;
{<<"TZ">>, <<"vcard-temp">>} -> true;
{<<"MAILER">>, <<"vcard-temp">>} -> true;
{<<"JABBERID">>, <<"vcard-temp">>} -> true;
{<<"BDAY">>, <<"vcard-temp">>} -> true;
{<<"NICKNAME">>, <<"vcard-temp">>} -> true;
{<<"FN">>, <<"vcard-temp">>} -> true;
{<<"VERSION">>, <<"vcard-temp">>} -> true;
{<<"CRED">>, <<"vcard-temp">>} -> true;
{<<"PHONETIC">>, <<"vcard-temp">>} -> true;
{<<"ORGUNIT">>, <<"vcard-temp">>} -> true;
{<<"ORGNAME">>, <<"vcard-temp">>} -> true;
{<<"LON">>, <<"vcard-temp">>} -> true;
{<<"LAT">>, <<"vcard-temp">>} -> true;
{<<"USERID">>, <<"vcard-temp">>} -> true;
{<<"NUMBER">>, <<"vcard-temp">>} -> true;
{<<"LINE">>, <<"vcard-temp">>} -> true;
{<<"CTRY">>, <<"vcard-temp">>} -> true;
{<<"PCODE">>, <<"vcard-temp">>} -> true;
{<<"REGION">>, <<"vcard-temp">>} -> true;
{<<"LOCALITY">>, <<"vcard-temp">>} -> true;
{<<"STREET">>, <<"vcard-temp">>} -> true;
{<<"EXTADD">>, <<"vcard-temp">>} -> true;
{<<"POBOX">>, <<"vcard-temp">>} -> true;
{<<"SUFFIX">>, <<"vcard-temp">>} -> true;
{<<"PREFIX">>, <<"vcard-temp">>} -> true;
{<<"MIDDLE">>, <<"vcard-temp">>} -> true;
{<<"GIVEN">>, <<"vcard-temp">>} -> true;
{<<"FAMILY">>, <<"vcard-temp">>} -> true;
{<<"X400">>, <<"vcard-temp">>} -> true;
{<<"INTERNET">>, <<"vcard-temp">>} -> true;
{<<"PREF">>, <<"vcard-temp">>} -> true;
{<<"INTL">>, <<"vcard-temp">>} -> true;
{<<"DOM">>, <<"vcard-temp">>} -> true;
{<<"PARCEL">>, <<"vcard-temp">>} -> true;
{<<"POSTAL">>, <<"vcard-temp">>} -> true;
{<<"PCS">>, <<"vcard-temp">>} -> true;
{<<"ISDN">>, <<"vcard-temp">>} -> true;
{<<"MODEM">>, <<"vcard-temp">>} -> true;
{<<"BBS">>, <<"vcard-temp">>} -> true;
{<<"VIDEO">>, <<"vcard-temp">>} -> true;
{<<"CELL">>, <<"vcard-temp">>} -> true;
{<<"MSG">>, <<"vcard-temp">>} -> true;
{<<"PAGER">>, <<"vcard-temp">>} -> true;
{<<"FAX">>, <<"vcard-temp">>} -> true;
{<<"VOICE">>, <<"vcard-temp">>} -> true;
{<<"WORK">>, <<"vcard-temp">>} -> true;
{<<"HOME">>, <<"vcard-temp">>} -> true;
{<<"stream:error">>,
<<"http://etherx.jabber.org/streams">>} ->
true;
{<<"unsupported-version">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"unsupported-stanza-type">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"unsupported-encoding">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"undefined-condition">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"system-shutdown">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"see-other-host">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"restricted-xml">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"resource-constraint">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"reset">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"remote-connection-failed">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"policy-violation">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"not-well-formed">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"not-authorized">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"invalid-xml">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"invalid-namespace">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"invalid-id">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"invalid-from">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"internal-server-error">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"improper-addressing">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"host-unknown">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"host-gone">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"connection-timeout">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"conflict">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"bad-namespace-prefix">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"bad-format">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"text">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>} ->
true;
{<<"time">>, <<"urn:xmpp:time">>} -> true;
{<<"tzo">>, <<"urn:xmpp:time">>} -> true;
{<<"utc">>, <<"urn:xmpp:time">>} -> true;
{<<"ping">>, <<"urn:xmpp:ping">>} -> true;
{<<"session">>,
<<"urn:ietf:params:xml:ns:xmpp-session">>} ->
true;
{<<"query">>, <<"jabber:iq:register">>} -> true;
{<<"key">>, <<"jabber:iq:register">>} -> true;
{<<"text">>, <<"jabber:iq:register">>} -> true;
{<<"misc">>, <<"jabber:iq:register">>} -> true;
{<<"date">>, <<"jabber:iq:register">>} -> true;
{<<"url">>, <<"jabber:iq:register">>} -> true;
{<<"phone">>, <<"jabber:iq:register">>} -> true;
{<<"zip">>, <<"jabber:iq:register">>} -> true;
{<<"state">>, <<"jabber:iq:register">>} -> true;
{<<"city">>, <<"jabber:iq:register">>} -> true;
{<<"address">>, <<"jabber:iq:register">>} -> true;
{<<"email">>, <<"jabber:iq:register">>} -> true;
{<<"last">>, <<"jabber:iq:register">>} -> true;
{<<"first">>, <<"jabber:iq:register">>} -> true;
{<<"name">>, <<"jabber:iq:register">>} -> true;
{<<"password">>, <<"jabber:iq:register">>} -> true;
{<<"nick">>, <<"jabber:iq:register">>} -> true;
{<<"username">>, <<"jabber:iq:register">>} -> true;
{<<"instructions">>, <<"jabber:iq:register">>} -> true;
{<<"remove">>, <<"jabber:iq:register">>} -> true;
{<<"registered">>, <<"jabber:iq:register">>} -> true;
{<<"register">>,
<<"http://jabber.org/features/iq-register">>} ->
true;
{<<"c">>, <<"http://jabber.org/protocol/caps">>} ->
true;
{<<"ack">>, <<"p1:ack">>} -> true;
{<<"rebind">>, <<"p1:rebind">>} -> true;
{<<"push">>, <<"p1:push">>} -> true;
{<<"stream:features">>,
<<"http://etherx.jabber.org/streams">>} ->
true;
{<<"compression">>,
<<"http://jabber.org/features/compress">>} ->
true;
{<<"method">>,
<<"http://jabber.org/features/compress">>} ->
true;
{<<"compressed">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"compress">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"method">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"failure">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"unsupported-method">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"processing-failed">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"setup-failed">>,
<<"http://jabber.org/protocol/compress">>} ->
true;
{<<"failure">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
true;
{<<"proceed">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
true;
{<<"starttls">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
true;
{<<"required">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>} ->
true;
{<<"mechanisms">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"mechanism">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"failure">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"temporary-auth-failure">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"not-authorized">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"mechanism-too-weak">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"malformed-request">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"invalid-mechanism">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"invalid-authzid">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"incorrect-encoding">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"encryption-required">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"credentials-expired">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"account-disabled">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"aborted">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"text">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"success">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"response">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"challenge">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"abort">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"auth">>, <<"urn:ietf:params:xml:ns:xmpp-sasl">>} ->
true;
{<<"bind">>, <<"urn:ietf:params:xml:ns:xmpp-bind">>} ->
true;
{<<"resource">>,
<<"urn:ietf:params:xml:ns:xmpp-bind">>} ->
true;
{<<"jid">>, <<"urn:ietf:params:xml:ns:xmpp-bind">>} ->
true;
{<<"error">>, <<"jabber:client">>} -> true;
{<<"text">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"unexpected-request">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"undefined-condition">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"subscription-required">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"service-unavailable">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"resource-constraint">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"remote-server-timeout">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"remote-server-not-found">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"registration-required">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"redirect">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"recipient-unavailable">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"policy-violation">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"not-authorized">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"not-allowed">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"not-acceptable">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"jid-malformed">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"item-not-found">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"internal-server-error">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"gone">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"forbidden">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"feature-not-implemented">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"conflict">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"bad-request">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>} ->
true;
{<<"presence">>, <<"jabber:client">>} -> true;
{<<"priority">>, <<"jabber:client">>} -> true;
{<<"status">>, <<"jabber:client">>} -> true;
{<<"show">>, <<"jabber:client">>} -> true;
{<<"message">>, <<"jabber:client">>} -> true;
{<<"thread">>, <<"jabber:client">>} -> true;
{<<"body">>, <<"jabber:client">>} -> true;
{<<"subject">>, <<"jabber:client">>} -> true;
{<<"iq">>, <<"jabber:client">>} -> true;
{<<"query">>, <<"http://jabber.org/protocol/stats">>} ->
true;
{<<"stat">>, <<"http://jabber.org/protocol/stats">>} ->
true;
{<<"error">>, <<"http://jabber.org/protocol/stats">>} ->
true;
{<<"storage">>, <<"storage:bookmarks">>} -> true;
{<<"url">>, <<"storage:bookmarks">>} -> true;
{<<"conference">>, <<"storage:bookmarks">>} -> true;
{<<"password">>, <<"storage:bookmarks">>} -> true;
{<<"nick">>, <<"storage:bookmarks">>} -> true;
{<<"query">>, <<"jabber:iq:private">>} -> true;
{<<"query">>,
<<"http://jabber.org/protocol/disco#items">>} ->
true;
{<<"item">>,
<<"http://jabber.org/protocol/disco#items">>} ->
true;
{<<"query">>,
<<"http://jabber.org/protocol/disco#info">>} ->
true;
{<<"feature">>,
<<"http://jabber.org/protocol/disco#info">>} ->
true;
{<<"identity">>,
<<"http://jabber.org/protocol/disco#info">>} ->
true;
{<<"blocklist">>, <<"urn:xmpp:blocking">>} -> true;
{<<"unblock">>, <<"urn:xmpp:blocking">>} -> true;
{<<"block">>, <<"urn:xmpp:blocking">>} -> true;
{<<"item">>, <<"urn:xmpp:blocking">>} -> true;
{<<"query">>, <<"jabber:iq:privacy">>} -> true;
{<<"active">>, <<"jabber:iq:privacy">>} -> true;
{<<"default">>, <<"jabber:iq:privacy">>} -> true;
{<<"list">>, <<"jabber:iq:privacy">>} -> true;
{<<"item">>, <<"jabber:iq:privacy">>} -> true;
{<<"presence-out">>, <<"jabber:iq:privacy">>} -> true;
{<<"presence-in">>, <<"jabber:iq:privacy">>} -> true;
{<<"iq">>, <<"jabber:iq:privacy">>} -> true;
{<<"message">>, <<"jabber:iq:privacy">>} -> true;
{<<"query">>, <<"jabber:iq:roster">>} -> true;
{<<"item">>, <<"jabber:iq:roster">>} -> true;
{<<"group">>, <<"jabber:iq:roster">>} -> true;
{<<"query">>, <<"jabber:iq:version">>} -> true;
{<<"os">>, <<"jabber:iq:version">>} -> true;
{<<"version">>, <<"jabber:iq:version">>} -> true;
{<<"name">>, <<"jabber:iq:version">>} -> true;
{<<"query">>, <<"jabber:iq:last">>} -> true;
_ -> false
end.
encode({carbons_sent, _} = Sent) ->
encode_carbons_sent(Sent,
[{<<"xmlns">>, <<"urn:xmpp:carbons:2">>}]);
encode({carbons_received, _} = Received) ->
encode_carbons_received(Received,
[{<<"xmlns">>, <<"urn:xmpp:carbons:2">>}]);
encode({carbons_private} = Private) ->
encode_carbons_private(Private,
[{<<"xmlns">>, <<"urn:xmpp:carbons:2">>}]);
encode({carbons_enable} = Enable) ->
encode_carbons_enable(Enable,
[{<<"xmlns">>, <<"urn:xmpp:carbons:2">>}]);
encode({carbons_disable} = Disable) ->
encode_carbons_disable(Disable,
[{<<"xmlns">>, <<"urn:xmpp:carbons:2">>}]);
encode({forwarded, _, _} = Forwarded) ->
encode_forwarded(Forwarded,
[{<<"xmlns">>, <<"urn:xmpp:forward:0">>}]);
encode({muc, _, _} = X) ->
encode_muc(X,
[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]);
encode({muc_admin, _} = Query) ->
encode_muc_admin(Query,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#admin">>}]);
encode({muc_owner, _, _} = Query) ->
encode_muc_owner(Query,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#owner">>}]);
encode({muc_owner_destroy, _, _, _} = Destroy) ->
encode_muc_owner_destroy(Destroy,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#owner">>}]);
encode({muc_user, _, _, _, _, _, _} = X) ->
encode_muc_user(X,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#user">>}]);
encode({muc_invite, _, _, _} = Invite) ->
encode_muc_user_invite(Invite,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#user">>}]);
encode({muc_user_destroy, _, _} = Destroy) ->
encode_muc_user_destroy(Destroy,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#user">>}]);
encode({muc_decline, _, _, _} = Decline) ->
encode_muc_user_decline(Decline,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/muc#user">>}]);
encode({muc_history, _, _, _, _} = History) ->
encode_muc_history(History,
[{<<"xmlns">>, <<"http://jabber.org/protocol/muc">>}]);
encode({bytestreams, _, _, _, _, _, _} = Query) ->
encode_bytestreams(Query,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/bytestreams">>}]);
encode({streamhost, _, _, _} = Streamhost) ->
encode_bytestreams_streamhost(Streamhost,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/bytestreams">>}]);
encode({legacy_delay, _, _} = X) ->
encode_legacy_delay(X,
[{<<"xmlns">>, <<"jabber:x:delay">>}]);
encode({delay, _, _} = Delay) ->
encode_delay(Delay,
[{<<"xmlns">>, <<"urn:xmpp:delay">>}]);
encode({shim, _} = Headers) ->
encode_shim_headers(Headers,
[{<<"xmlns">>, <<"http://jabber.org/protocol/shim">>}]);
encode({pubsub, _, _, _, _, _, _, _, _} = Pubsub) ->
encode_pubsub(Pubsub,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_retract, _, _, _} = Retract) ->
encode_pubsub_retract(Retract,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_options, _, _, _, _} = Options) ->
encode_pubsub_options(Options,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_publish, _, _} = Publish) ->
encode_pubsub_publish(Publish,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_unsubscribe, _, _, _} = Unsubscribe) ->
encode_pubsub_unsubscribe(Unsubscribe,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_subscribe, _, _} = Subscribe) ->
encode_pubsub_subscribe(Subscribe,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_event, _} = Event) ->
encode_pubsub_event(Event,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}]);
encode({pubsub_event_items, _, _, _} = Items) ->
encode_pubsub_event_items(Items,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}]);
encode({pubsub_event_item, _, _, _} = Item) ->
encode_pubsub_event_item(Item,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}]);
encode({pubsub_items, _, _, _, _} = Items) ->
encode_pubsub_items(Items,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_item, _, _} = Item) ->
encode_pubsub_item(Item,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_affiliation, _, _} = Affiliation) ->
encode_pubsub_affiliation(Affiliation,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({pubsub_subscription, _, _, _, _} =
Subscription) ->
encode_pubsub_subscription(Subscription,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub">>}]);
encode({xdata, _, _, _, _, _, _} = X) ->
encode_xdata(X, [{<<"xmlns">>, <<"jabber:x:data">>}]);
encode({xdata_field, _, _, _, _, _, _, _} = Field) ->
encode_xdata_field(Field,
[{<<"xmlns">>, <<"jabber:x:data">>}]);
encode({vcard, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _} =
Vcard) ->
encode_vcard(Vcard, [{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_key, _, _} = Key) ->
encode_vcard_KEY(Key,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_sound, _, _, _} = Sound) ->
encode_vcard_SOUND(Sound,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_org, _, _} = Org) ->
encode_vcard_ORG(Org,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_photo, _, _, _} = Photo) ->
encode_vcard_PHOTO(Photo,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_logo, _, _, _} = Logo) ->
encode_vcard_LOGO(Logo,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_geo, _, _} = Geo) ->
encode_vcard_GEO(Geo,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_email, _, _, _, _, _, _} = Email) ->
encode_vcard_EMAIL(Email,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_tel, _, _, _, _, _, _, _, _, _, _, _, _,
_, _} =
Tel) ->
encode_vcard_TEL(Tel,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_label, _, _, _, _, _, _, _, _} = Label) ->
encode_vcard_LABEL(Label,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_adr, _, _, _, _, _, _, _, _, _, _, _, _,
_, _} =
Adr) ->
encode_vcard_ADR(Adr,
[{<<"xmlns">>, <<"vcard-temp">>}]);
encode({vcard_name, _, _, _, _, _} = N) ->
encode_vcard_N(N, [{<<"xmlns">>, <<"vcard-temp">>}]);
encode({stream_error, _, _} = Stream_error) ->
encode_stream_error(Stream_error,
[{<<"xmlns">>,
<<"http://etherx.jabber.org/streams">>}]);
encode({'see-other-host', _} = See_other_host) ->
encode_stream_error_see_other_host(See_other_host,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-streams">>}]);
encode({time, _, _} = Time) ->
encode_time(Time, [{<<"xmlns">>, <<"urn:xmpp:time">>}]);
encode({ping} = Ping) ->
encode_ping(Ping, [{<<"xmlns">>, <<"urn:xmpp:ping">>}]);
encode({session} = Session) ->
encode_session(Session,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-session">>}]);
encode({register, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _} =
Query) ->
encode_register(Query,
[{<<"xmlns">>, <<"jabber:iq:register">>}]);
encode({feature_register} = Register) ->
encode_feature_register(Register,
[{<<"xmlns">>,
<<"http://jabber.org/features/iq-register">>}]);
encode({caps, _, _, _} = C) ->
encode_caps(C,
[{<<"xmlns">>, <<"http://jabber.org/protocol/caps">>}]);
encode({p1_ack} = Ack) ->
encode_p1_ack(Ack, [{<<"xmlns">>, <<"p1:ack">>}]);
encode({p1_rebind} = Rebind) ->
encode_p1_rebind(Rebind,
[{<<"xmlns">>, <<"p1:rebind">>}]);
encode({p1_push} = Push) ->
encode_p1_push(Push, [{<<"xmlns">>, <<"p1:push">>}]);
encode({stream_features, _} = Stream_features) ->
encode_stream_features(Stream_features,
[{<<"xmlns">>,
<<"http://etherx.jabber.org/streams">>}]);
encode({compression, _} = Compression) ->
encode_compression(Compression,
[{<<"xmlns">>,
<<"http://jabber.org/features/compress">>}]);
encode({compressed} = Compressed) ->
encode_compressed(Compressed,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/compress">>}]);
encode({compress, _} = Compress) ->
encode_compress(Compress,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/compress">>}]);
encode({compress_failure, _} = Failure) ->
encode_compress_failure(Failure,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/compress">>}]);
encode({starttls_failure} = Failure) ->
encode_starttls_failure(Failure,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>}]);
encode({starttls_proceed} = Proceed) ->
encode_starttls_proceed(Proceed,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-tls">>}]);
encode({starttls, _} = Starttls) ->
encode_starttls(Starttls,
[{<<"xmlns">>, <<"urn:ietf:params:xml:ns:xmpp-tls">>}]);
encode({sasl_mechanisms, _} = Mechanisms) ->
encode_sasl_mechanisms(Mechanisms,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({sasl_failure, _, _} = Failure) ->
encode_sasl_failure(Failure,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({sasl_success, _} = Success) ->
encode_sasl_success(Success,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({sasl_response, _} = Response) ->
encode_sasl_response(Response,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({sasl_challenge, _} = Challenge) ->
encode_sasl_challenge(Challenge,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({sasl_abort} = Abort) ->
encode_sasl_abort(Abort,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({sasl_auth, _, _} = Auth) ->
encode_sasl_auth(Auth,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}]);
encode({bind, _, _} = Bind) ->
encode_bind(Bind,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-bind">>}]);
encode({error, _, _, _, _} = Error) ->
encode_error(Error,
[{<<"xmlns">>, <<"jabber:client">>}]);
encode({redirect, _} = Redirect) ->
encode_error_redirect(Redirect,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}]);
encode({gone, _} = Gone) ->
encode_error_gone(Gone,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}]);
encode({presence, _, _, _, _, _, _, _, _, _, _} =
Presence) ->
encode_presence(Presence,
[{<<"xmlns">>, <<"jabber:client">>}]);
encode({message, _, _, _, _, _, _, _, _, _, _} =
Message) ->
encode_message(Message,
[{<<"xmlns">>, <<"jabber:client">>}]);
encode({iq, _, _, _, _, _, _, _} = Iq) ->
encode_iq(Iq, [{<<"xmlns">>, <<"jabber:client">>}]);
encode({stats, _} = Query) ->
encode_stats(Query,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/stats">>}]);
encode({stat, _, _, _, _} = Stat) ->
encode_stat(Stat,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/stats">>}]);
encode({bookmark_storage, _, _} = Storage) ->
encode_bookmarks_storage(Storage,
[{<<"xmlns">>, <<"storage:bookmarks">>}]);
encode({bookmark_url, _, _} = Url) ->
encode_bookmark_url(Url,
[{<<"xmlns">>, <<"storage:bookmarks">>}]);
encode({bookmark_conference, _, _, _, _, _} =
Conference) ->
encode_bookmark_conference(Conference,
[{<<"xmlns">>, <<"storage:bookmarks">>}]);
encode({private, _} = Query) ->
encode_private(Query,
[{<<"xmlns">>, <<"jabber:iq:private">>}]);
encode({disco_items, _, _} = Query) ->
encode_disco_items(Query,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/disco#items">>}]);
encode({disco_item, _, _, _} = Item) ->
encode_disco_item(Item,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/disco#items">>}]);
encode({disco_info, _, _, _, _} = Query) ->
encode_disco_info(Query,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/disco#info">>}]);
encode({identity, _, _, _, _} = Identity) ->
encode_disco_identity(Identity,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/disco#info">>}]);
encode({block_list} = Blocklist) ->
encode_block_list(Blocklist,
[{<<"xmlns">>, <<"urn:xmpp:blocking">>}]);
encode({unblock, _} = Unblock) ->
encode_unblock(Unblock,
[{<<"xmlns">>, <<"urn:xmpp:blocking">>}]);
encode({block, _} = Block) ->
encode_block(Block,
[{<<"xmlns">>, <<"urn:xmpp:blocking">>}]);
encode({privacy, _, _, _} = Query) ->
encode_privacy(Query,
[{<<"xmlns">>, <<"jabber:iq:privacy">>}]);
encode({privacy_list, _, _} = List) ->
encode_privacy_list(List,
[{<<"xmlns">>, <<"jabber:iq:privacy">>}]);
encode({privacy_item, _, _, _, _, _} = Item) ->
encode_privacy_item(Item,
[{<<"xmlns">>, <<"jabber:iq:privacy">>}]);
encode({roster, _, _} = Query) ->
encode_roster(Query,
[{<<"xmlns">>, <<"jabber:iq:roster">>}]);
encode({roster_item, _, _, _, _, _} = Item) ->
encode_roster_item(Item,
[{<<"xmlns">>, <<"jabber:iq:roster">>}]);
encode({version, _, _, _} = Query) ->
encode_version(Query,
[{<<"xmlns">>, <<"jabber:iq:version">>}]);
encode({last, _, _} = Query) ->
encode_last(Query,
[{<<"xmlns">>, <<"jabber:iq:last">>}]).
dec_int(Val) -> dec_int(Val, infinity, infinity).
dec_int(Val, Min, Max) ->
case list_to_integer(binary_to_list(Val)) of
Int when Int =< Max, Min == infinity -> Int;
Int when Int =< Max, Int >= Min -> Int
end.
enc_int(Int) -> list_to_binary(integer_to_list(Int)).
dec_enum(Val, Enums) ->
AtomVal = erlang:binary_to_existing_atom(Val, utf8),
case lists:member(AtomVal, Enums) of
true -> AtomVal
end.
enc_enum(Atom) -> erlang:atom_to_binary(Atom, utf8).
format_error({bad_attr_value, Attr, Tag, XMLNS}) ->
<<"Bad value of attribute '", Attr/binary, "' in tag <",
Tag/binary, "/> qualified by namespace '", XMLNS/binary,
"'">>;
format_error({bad_cdata_value, <<>>, Tag, XMLNS}) ->
<<"Bad value of cdata in tag <", Tag/binary,
"/> qualified by namespace '", XMLNS/binary, "'">>;
format_error({missing_tag, Tag, XMLNS}) ->
<<"Missing tag <", Tag/binary,
"/> qualified by namespace '", XMLNS/binary, "'">>;
format_error({missing_attr, Attr, Tag, XMLNS}) ->
<<"Missing attribute '", Attr/binary, "' in tag <",
Tag/binary, "/> qualified by namespace '", XMLNS/binary,
"'">>;
format_error({missing_cdata, <<>>, Tag, XMLNS}) ->
<<"Missing cdata in tag <", Tag/binary,
"/> qualified by namespace '", XMLNS/binary, "'">>;
format_error({unknown_tag, Tag, XMLNS}) ->
<<"Unknown tag <", Tag/binary,
"/> qualified by namespace '", XMLNS/binary, "'">>.
get_attr(Attr, Attrs) ->
case lists:keyfind(Attr, 1, Attrs) of
{_, Val} -> Val;
false -> <<>>
end.
pp(Term) -> io_lib_pretty:print(Term, fun pp/2).
pp(last, 2) -> [seconds, text];
pp(version, 3) -> [name, ver, os];
pp(roster_item, 5) ->
[jid, name, groups, subscription, ask];
pp(roster, 2) -> [items, ver];
pp(privacy_item, 5) ->
[order, action, type, value, kinds];
pp(privacy_list, 2) -> [name, items];
pp(privacy, 3) -> [lists, default, active];
pp(block, 1) -> [items];
pp(unblock, 1) -> [items];
pp(block_list, 0) -> [];
pp(identity, 4) -> [category, type, lang, name];
pp(disco_info, 4) ->
[node, identities, features, xdata];
pp(disco_item, 3) -> [jid, name, node];
pp(disco_items, 2) -> [node, items];
pp(private, 1) -> [xml_els];
pp(bookmark_conference, 5) ->
[name, jid, autojoin, nick, password];
pp(bookmark_url, 2) -> [name, url];
pp(bookmark_storage, 2) -> [conference, url];
pp(stat, 4) -> [name, units, value, error];
pp(stats, 1) -> [stat];
pp(iq, 7) -> [id, type, lang, from, to, error, sub_els];
pp(message, 10) ->
[id, type, lang, from, to, subject, body, thread, error,
sub_els];
pp(presence, 10) ->
[id, type, lang, from, to, show, status, priority,
error, sub_els];
pp(gone, 1) -> [uri];
pp(redirect, 1) -> [uri];
pp(error, 4) -> [type, by, reason, text];
pp(bind, 2) -> [jid, resource];
pp(sasl_auth, 2) -> [mechanism, text];
pp(sasl_abort, 0) -> [];
pp(sasl_challenge, 1) -> [text];
pp(sasl_response, 1) -> [text];
pp(sasl_success, 1) -> [text];
pp(sasl_failure, 2) -> [reason, text];
pp(sasl_mechanisms, 1) -> [list];
pp(starttls, 1) -> [required];
pp(starttls_proceed, 0) -> [];
pp(starttls_failure, 0) -> [];
pp(compress_failure, 1) -> [reason];
pp(compress, 1) -> [methods];
pp(compressed, 0) -> [];
pp(compression, 1) -> [methods];
pp(stream_features, 1) -> [sub_els];
pp(p1_push, 0) -> [];
pp(p1_rebind, 0) -> [];
pp(p1_ack, 0) -> [];
pp(caps, 3) -> [hash, node, ver];
pp(feature_register, 0) -> [];
pp(register, 20) ->
[registered, remove, instructions, username, nick,
password, name, first, last, email, address, city,
state, zip, phone, url, date, misc, text, key];
pp(session, 0) -> [];
pp(ping, 0) -> [];
pp(time, 2) -> [tzo, utc];
pp(text, 2) -> [lang, data];
pp('see-other-host', 1) -> [host];
pp(stream_error, 2) -> [reason, text];
pp(vcard_name, 5) ->
[family, given, middle, prefix, suffix];
pp(vcard_adr, 14) ->
[home, work, postal, parcel, dom, intl, pref, pobox,
extadd, street, locality, region, pcode, ctry];
pp(vcard_label, 8) ->
[home, work, postal, parcel, dom, intl, pref, line];
pp(vcard_tel, 14) ->
[home, work, voice, fax, pager, msg, cell, video, bbs,
modem, isdn, pcs, pref, number];
pp(vcard_email, 6) ->
[home, work, internet, pref, x400, userid];
pp(vcard_geo, 2) -> [lat, lon];
pp(vcard_logo, 3) -> [type, binval, extval];
pp(vcard_photo, 3) -> [type, binval, extval];
pp(vcard_org, 2) -> [name, units];
pp(vcard_sound, 3) -> [phonetic, binval, extval];
pp(vcard_key, 2) -> [type, cred];
pp(vcard, 29) ->
[version, fn, n, nickname, photo, bday, adr, label, tel,
email, jabberid, mailer, tz, geo, title, role, logo,
org, categories, note, prodid, rev, sort_string, sound,
uid, url, class, key, desc];
pp(xdata_field, 7) ->
[label, type, var, required, desc, values, options];
pp(xdata, 6) ->
[type, instructions, title, reported, items, fields];
pp(pubsub_subscription, 4) -> [jid, node, subid, type];
pp(pubsub_affiliation, 2) -> [node, type];
pp(pubsub_item, 2) -> [id, xml_els];
pp(pubsub_items, 4) -> [node, max_items, subid, items];
pp(pubsub_event_item, 3) -> [id, node, publisher];
pp(pubsub_event_items, 3) -> [node, retract, items];
pp(pubsub_event, 1) -> [items];
pp(pubsub_subscribe, 2) -> [node, jid];
pp(pubsub_unsubscribe, 3) -> [node, jid, subid];
pp(pubsub_publish, 2) -> [node, items];
pp(pubsub_options, 4) -> [node, jid, subid, xdata];
pp(pubsub_retract, 3) -> [node, notify, items];
pp(pubsub, 8) ->
[subscriptions, affiliations, publish, subscribe,
unsubscribe, options, items, retract];
pp(shim, 1) -> [headers];
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];
pp(muc_history, 4) ->
[maxchars, maxstanzas, seconds, since];
pp(muc_decline, 3) -> [reason, from, to];
pp(muc_user_destroy, 2) -> [reason, jid];
pp(muc_invite, 3) -> [reason, from, to];
pp(muc_user, 6) ->
[decline, destroy, invites, items, status_codes,
password];
pp(muc_owner_destroy, 3) -> [jid, reason, password];
pp(muc_owner, 2) -> [destroy, config];
pp(muc_item, 7) ->
[actor, continue, reason, affiliation, role, jid, nick];
pp(muc_actor, 2) -> [jid, nick];
pp(muc_admin, 1) -> [items];
pp(muc, 2) -> [history, password];
pp(forwarded, 2) -> [delay, sub_els];
pp(carbons_disable, 0) -> [];
pp(carbons_enable, 0) -> [];
pp(carbons_private, 0) -> [];
pp(carbons_received, 1) -> [forwarded];
pp(carbons_sent, 1) -> [forwarded];
pp(_, _) -> no.
enc_bool(false) -> <<"false">>;
enc_bool(true) -> <<"true">>.
dec_bool(<<"false">>) -> false;
dec_bool(<<"true">>) -> true.
resourceprep(R) ->
case jlib:resourceprep(R) of
error -> erlang:error(badarg);
R1 -> R1
end.
enc_jid(J) -> jlib:jid_to_string(J).
dec_jid(Val) ->
case jlib:string_to_jid(Val) of
error -> erlang:error(badarg);
J -> J
end.
enc_utc(Val) -> jlib:now_to_utc_string(Val).
dec_utc(Val) ->
{_, _, _} = jlib:datetime_string_to_timestamp(Val).
enc_tzo({H, M}) ->
Sign = if H >= 0 -> <<>>;
true -> <<"-">>
end,
list_to_binary([Sign,
io_lib:format("~2..0w:~2..0w", [H, M])]).
dec_tzo(Val) ->
[H1, M1] = str:tokens(Val, <<":">>),
H = jlib:binary_to_integer(H1),
M = jlib:binary_to_integer(M1),
if H >= -12, H =< 12, M >= 0, M < 60 -> {H, M} end.
decode_carbons_sent({xmlel, <<"sent">>, _attrs,
_els}) ->
Forwarded = decode_carbons_sent_els(_els, error),
{carbons_sent, Forwarded}.
decode_carbons_sent_els([], Forwarded) ->
case Forwarded of
error ->
erlang:error({xmpp_codec,
{missing_tag, <<"forwarded">>,
<<"urn:xmpp:forward:0">>}});
{value, Forwarded1} -> Forwarded1
end;
decode_carbons_sent_els([{xmlel, <<"forwarded">>,
_attrs, _} =
_el
| _els],
Forwarded) ->
_xmlns = get_attr(<<"xmlns">>, _attrs),
if _xmlns == <<"urn:xmpp:forward:0">> ->
decode_carbons_sent_els(_els,
{value, decode_forwarded(_el)});
true -> decode_carbons_sent_els(_els, Forwarded)
end;
decode_carbons_sent_els([_ | _els], Forwarded) ->
decode_carbons_sent_els(_els, Forwarded).
encode_carbons_sent({carbons_sent, Forwarded},
_xmlns_attrs) ->
_els = 'encode_carbons_sent_$forwarded'(Forwarded, []),
_attrs = _xmlns_attrs,
{xmlel, <<"sent">>, _attrs, _els}.
'encode_carbons_sent_$forwarded'(Forwarded, _acc) ->
[encode_forwarded(Forwarded,
[{<<"xmlns">>, <<"urn:xmpp:forward:0">>}])
| _acc].
decode_carbons_received({xmlel, <<"received">>, _attrs,
_els}) ->
Forwarded = decode_carbons_received_els(_els, error),
{carbons_received, Forwarded}.
decode_carbons_received_els([], Forwarded) ->
case Forwarded of
error ->
erlang:error({xmpp_codec,
{missing_tag, <<"forwarded">>,
<<"urn:xmpp:forward:0">>}});
{value, Forwarded1} -> Forwarded1
end;
decode_carbons_received_els([{xmlel, <<"forwarded">>,
_attrs, _} =
_el
| _els],
Forwarded) ->
_xmlns = get_attr(<<"xmlns">>, _attrs),
if _xmlns == <<"urn:xmpp:forward:0">> ->
decode_carbons_received_els(_els,
{value, decode_forwarded(_el)});
true -> decode_carbons_received_els(_els, Forwarded)
end;
decode_carbons_received_els([_ | _els], Forwarded) ->
decode_carbons_received_els(_els, Forwarded).
encode_carbons_received({carbons_received, Forwarded},
_xmlns_attrs) ->
_els = 'encode_carbons_received_$forwarded'(Forwarded,
[]),
_attrs = _xmlns_attrs,
{xmlel, <<"received">>, _attrs, _els}.
'encode_carbons_received_$forwarded'(Forwarded, _acc) ->
[encode_forwarded(Forwarded,
[{<<"xmlns">>, <<"urn:xmpp:forward:0">>}])
| _acc].
decode_carbons_private({xmlel, <<"private">>, _attrs,
_els}) ->
{carbons_private}.
encode_carbons_private({carbons_private},
_xmlns_attrs) ->
_els = [],
_attrs = _xmlns_attrs,
{xmlel, <<"private">>, _attrs, _els}.
decode_carbons_enable({xmlel, <<"enable">>, _attrs,
_els}) ->