diff --git a/include/xmpp_codec.hrl b/include/xmpp_codec.hrl index 0f23226..6f218a7 100644 --- a/include/xmpp_codec.hrl +++ b/include/xmpp_codec.hrl @@ -1100,7 +1100,7 @@ sub_els = [] :: [xmpp_element() | fxml:xmlel()]}). -type jingle_reason() :: #jingle_reason{}. --record(jingle, {action :: atom(), +-record(jingle, {action :: 'content-accept' | 'content-add' | 'content-modify' | 'content-reject' | 'content-remove' | 'description-info' | 'security-info' | 'session-accept' | 'session-info' | 'session-initiate' | 'session-terminate' | 'transport-accept' | 'transport-info' | 'transport-reject' | 'transport-replace', sid = <<>> :: binary(), initiator :: undefined | jid:jid(), responder :: undefined | jid:jid(), @@ -1196,221 +1196,221 @@ utc :: undefined | erlang:timestamp()}). -type time() :: #time{}. --type xmpp_element() :: adhoc_note() | - sasl_response() | - privacy_list() | - services() | - jingle_ft_range() | - carbons_sent() | - message() | +-type xmpp_element() :: address() | + addresses() | + adhoc_actions() | + adhoc_command() | + adhoc_note() | + avatar_data() | + avatar_info() | + avatar_meta() | + avatar_pointer() | + bind() | + block() | + block_item() | + block_list() | + bob_data() | + bookmark_conference() | + bookmark_storage() | bookmark_url() | - muc_owner() | - muc_invite() | - shim() | - vcard_xupdate() | - private() | - pubsub() | - mix_setnick() | - offline() | - xdata() | - jingle_content() | - ps_subscription() | + bytestreams() | + caps() | carbons_disable() | - search() | - offline_item() | - muc_history() | - starttls_failure() | - sic() | - feature_sm() | - ibb_close() | - x509_revoke() | - delegation() | + carbons_enable() | + carbons_private() | + carbons_received() | + carbons_sent() | chatstate() | - jingle_ft_received() | - hint() | - bookmark_storage() | - vcard_geo() | - xevent() | - sasl_auth() | + compress() | + compress_failure() | + compressed() | + compression() | + credentials() | + csi() | + db_feature() | + db_result() | db_verify() | + delay() | delegated() | - carbons_enable() | - redirect() | + delegation() | + delegation_query() | + disco_info() | disco_item() | - roster_query() | - adhoc_command() | - pubsub_owner() | - credentials() | - jingle_ft_description() | - compression() | - muc_decline() | - receipt_response() | - upload_request() | - mix_create() | - mam_prefs() | - origin_id() | - sm_a() | - vcard_logo() | - vcard_key() | - sm_enable() | + disco_items() | + expire() | + feature_csi() | + feature_register() | + feature_sm() | + forwarded() | + gone() | + handshake() | hash() | - muc_subscribe() | - addresses() | + hash_used() | + hint() | + ibb_close() | + ibb_data() | + ibb_open() | + identity() | + idle() | + iq() | + jidprep() | + jingle() | + jingle_content() | + jingle_error() | + jingle_ft_checksum() | + jingle_ft_description() | + jingle_ft_error() | + jingle_ft_file() | + jingle_ft_range() | + jingle_ft_received() | + jingle_ibb_transport() | jingle_reason() | - vcard_email() | - avatar_data() | - feature_csi() | - bob_data() | - sasl_success() | - sm_r() | + jingle_s5b_candidate() | + jingle_s5b_transport() | + last() | + legacy_auth() | + legacy_auth_feature() | + mam_archived() | + mam_fin() | + mam_prefs() | mam_query() | + mam_result() | + media() | + media_uri() | + message() | + message_thread() | + mix() | + mix_client_join() | mix_client_leave() | + mix_create() | + mix_destroy() | + mix_join() | + mix_leave() | + mix_participant() | + mix_setnick() | + muc() | + muc_actor() | + muc_admin() | + muc_decline() | + muc_destroy() | + muc_history() | + muc_invite() | + muc_item() | + muc_owner() | + muc_subscribe() | + muc_subscription() | + muc_subscriptions() | + muc_unique() | + muc_unsubscribe() | + muc_user() | + nick() | + offline() | + offline_item() | + oob_x() | + origin_id() | + ping() | + presence() | + privacy_item() | + privacy_list() | + privacy_query() | + private() | + privilege() | + privilege_perm() | + ps_affiliation() | + ps_error() | + ps_event() | + ps_item() | + ps_items() | + ps_options() | ps_publish() | - upload_request_0() | - stanza_error() | - xdata_field() | - jingle_ft_file() | - delegation_query() | - push_disable() | - search_item() | - x509_ca_list() | ps_retract() | ps_subscribe() | - muc_unique() | - x509_cert_chain() | - mix_destroy() | - media() | - gone() | - compressed() | - upload_slot_0() | + ps_subscription() | ps_unsubscribe() | - bind() | + pubsub() | + pubsub_owner() | + push_disable() | push_enable() | - vcard_label() | - muc_destroy() | - hash_used() | - rosterver_feature() | - last() | - ping() | - carbons_received() | - vcard_photo() | - x509_csr() | - handshake() | + push_notification() | + receipt_request() | + receipt_response() | + redirect() | + register() | + report() | roster_item() | - mam_fin() | - mix_client_join() | - block_list() | - mix() | - privilege_perm() | - carbons_private() | - avatar_info() | - stream_error() | - nick() | - ps_error() | - idle() | - bookmark_conference() | - jingle_s5b_candidate() | - avatar_pointer() | - jingle_ibb_transport() | - address() | - ps_affiliation() | - x509_request() | - muc_item() | - muc() | - upload_file_too_large() | - unblock() | + roster_query() | + rosterver_feature() | + rsm_first() | + rsm_set() | + sasl_abort() | + sasl_auth() | + sasl_challenge() | + sasl_failure() | sasl_mechanisms() | + sasl_response() | + sasl_success() | + search() | + search_item() | + 'see-other-host'() | + service() | + services() | + shim() | + sic() | + sm_a() | + sm_enable() | + sm_enabled() | sm_failed() | - csi() | + sm_r() | sm_resume() | sm_resumed() | - vcard_sound() | - mix_participant() | - 'see-other-host'() | - muc_user() | - bytestreams() | + stanza_error() | + stanza_id() | + starttls() | + starttls_failure() | + starttls_proceed() | + stat() | + stat_error() | + stats() | + stream_error() | + stream_features() | + stream_start() | streamhost() | - receipt_request() | - legacy_auth() | - jidprep() | - muc_subscriptions() | - oob_x() | - upload_slot() | - block_item() | - mix_join() | - sasl_challenge() | - mix_leave() | text() | - vcard_tel() | - caps() | - service() | - adhoc_actions() | thumbnail() | - jingle_error() | - stats() | - avatar_meta() | - rsm_set() | time() | - register() | - ps_item() | - forwarded() | - compress() | - muc_subscription() | - expire() | - privacy_query() | - sasl_failure() | - ps_items() | - stanza_id() | - x509_register() | - starttls_proceed() | - jingle_ft_checksum() | - disco_items() | - mam_result() | - presence() | - privacy_item() | - vcard_adr() | - xcaptcha() | + unblock() | + upload_file_too_large() | + upload_request() | + upload_request_0() | upload_retry() | - iq() | + upload_slot() | + upload_slot_0() | + vcard_adr() | + vcard_email() | + vcard_geo() | + vcard_key() | + vcard_label() | + vcard_logo() | + vcard_name() | + vcard_org() | + vcard_photo() | + vcard_sound() | + vcard_tel() | vcard_temp() | - jingle_s5b_transport() | - legacy_auth_feature() | + vcard_xupdate() | + version() | + x509_ca_list() | + x509_cert_chain() | x509_challenge() | - starttls() | - muc_unsubscribe() | - mam_archived() | - stat() | - ps_event() | - identity() | - ibb_data() | - ps_options() | - sm_enabled() | - compress_failure() | - muc_admin() | - sasl_abort() | - jingle_ft_error() | - push_notification() | - feature_register() | x509_challenge_failed() | - disco_info() | - rsm_first() | - media_uri() | - xdata_option() | + x509_csr() | + x509_register() | + x509_request() | + x509_revoke() | x_conference() | - stat_error() | - block() | - stream_start() | - delay() | - db_feature() | - vcard_name() | - db_result() | - vcard_org() | - version() | - stream_features() | - jingle() | - report() | - privilege() | - xmpp_session() | - muc_actor() | - ibb_open() | - message_thread(). + xcaptcha() | + xdata() | + xdata_field() | + xdata_option() | + xevent() | + xmpp_session(). diff --git a/specs/xmpp_codec.spec b/specs/xmpp_codec.spec index 7a8afcc..acb7610 100644 --- a/specs/xmpp_codec.spec +++ b/specs/xmpp_codec.spec @@ -4959,7 +4959,7 @@ dec_tzo(Val) -> enc_tzo({H, M}) -> Sign = if H >= 0 -> - <<>>; + <<"+">>; true -> <<"-">> end, diff --git a/src/xep0202.erl b/src/xep0202.erl index 40432f3..003a1ae 100644 --- a/src/xep0202.erl +++ b/src/xep0202.erl @@ -42,7 +42,7 @@ dec_tzo(Val) -> dec_utc(Val) -> xmpp_util:decode_timestamp(Val). enc_tzo({H, M}) -> - Sign = if H >= 0 -> <<>>; + Sign = if H >= 0 -> <<"+">>; true -> <<"-">> end, list_to_binary([Sign, diff --git a/src/xmpp_codec.erl b/src/xmpp_codec.erl index 1d56cfd..cd99e79 100644 --- a/src/xmpp_codec.erl +++ b/src/xmpp_codec.erl @@ -27,6 +27,7 @@ encode(El, TopXMLNS) -> Mod = get_mod(El), Mod:do_encode(El, TopXMLNS). + get_name(El) -> Mod = get_mod(El), Mod:do_get_name(El).