Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ and its nice display in [Erlang/Elixir XMPP at xmpp.org](https://xmpp.org/softwa
- [XEP-0363](https://xmpp.org/extensions/xep-0363.html): HTTP File Upload
- [XEP-0369](https://xmpp.org/extensions/xep-0369.html): Mediated Information eXchange (MIX)
- [XEP-0377](https://xmpp.org/extensions/xep-0377.html): Spam Reporting
- [XEP-0379](https://xmpp.org/extensions/xep-0379.html): Pre-Authenticated Roster Subscription
- [XEP-0386](https://xmpp.org/extensions/xep-0386.html): Bind 2
- [XEP-0388](https://xmpp.org/extensions/xep-0388.html): Extensible SASL Profile
- [XEP-0402](https://xmpp.org/extensions/xep-0402.html): PEP Native Bookmarks
Expand All @@ -333,6 +334,7 @@ and its nice display in [Erlang/Elixir XMPP at xmpp.org](https://xmpp.org/softwa
- [XEP-0425](https://xmpp.org/extensions/xep-0425.html): Message Moderation
- [XEP-0430](https://xmpp.org/extensions/xep-0430.html): Inbox
- [XEP-0440](https://xmpp.org/extensions/xep-0440.html): SASL Channel-Binding Type Capability
- [XEP-0445](https://xmpp.org/extensions/xep-0445.html): Pre-Authenticated In-Band Registration
- [XEP-0474](https://xmpp.org/extensions/xep-0474.html): SASL SCRAM Downgrade Protection
- [draft-cridland-xmpp-session-01](https://tools.ietf.org/html/draft-cridland-xmpp-session-01): XMPP Session Establishment

Expand Down
3 changes: 3 additions & 0 deletions include/ns.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,6 @@
-define(NS_MESSAGE_MODERATE_1, <<"urn:xmpp:message-moderate:1">>).
-define(NS_MESSAGE_RETRACT, <<"urn:xmpp:message-retract:1">>).
-define(NS_OCCUPANT_ID, <<"urn:xmpp:occupant-id:0">>).
-define(NS_PREAUTHENTICATED_ROSTER_SUBSCRIPTION, <<"urn:xmpp:pars:0">>).
-define(NS_FEATURE_IBR_TOKEN, <<"urn:xmpp:ibr-token:0">>).
-define(NS_FEATURE_SUB_PRE_APPROVAL, <<"urn:xmpp:features:pre-approval">>).
186 changes: 99 additions & 87 deletions include/xmpp_codec.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,9 @@
cdata = <<>> :: binary()}).
-type scram_upgrade_salt() :: #scram_upgrade_salt{}.

-record(receipt_request, {}).
-type receipt_request() :: #receipt_request{}.

-record(legacy_auth_feature, {}).
-type legacy_auth_feature() :: #legacy_auth_feature{}.

-record(rosterver_feature, {}).
-type rosterver_feature() :: #rosterver_feature{}.

-record(mix_roster_channel, {participant_id = <<>> :: binary()}).
-type mix_roster_channel() :: #mix_roster_channel{}.

Expand Down Expand Up @@ -341,6 +335,9 @@
-record(private, {sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
-type private() :: #private{}.

-record(preauth, {token = <<>> :: binary()}).
-type preauth() :: #preauth{}.

-record(scram_upgrade_hash, {data = <<>> :: binary()}).
-type scram_upgrade_hash() :: #scram_upgrade_hash{}.

Expand Down Expand Up @@ -389,6 +386,9 @@
id = <<>> :: binary()}).
-type inbox_entry() :: #inbox_entry{}.

-record(feature_register_ibr_token, {}).
-type feature_register_ibr_token() :: #feature_register_ibr_token{}.

-record(x509_challenge_failed, {}).
-type x509_challenge_failed() :: #x509_challenge_failed{}.

Expand Down Expand Up @@ -644,6 +644,9 @@
items = [] :: [#ps_item{}]}).
-type ps_publish() :: #ps_publish{}.

-record(feature_pre_approval, {}).
-type feature_pre_approval() :: #feature_pre_approval{}.

-record(report, {reason :: 'abuse' | 'spam',
text = [] :: [#text{}]}).
-type report() :: #report{}.
Expand Down Expand Up @@ -860,11 +863,6 @@
resource :: 'undefined' | binary()}).
-type legacy_auth() :: #legacy_auth{}.

-record(privacy_query, {lists = [] :: [#privacy_list{}],
default :: 'none' | 'undefined' | binary(),
active :: 'none' | 'undefined' | binary()}).
-type privacy_query() :: #privacy_query{}.

-record(pubsub_serverinfo_remote_domain, {name = <<>> :: binary(),
type = [] :: ['bidi' | 'incoming' | 'outgoing']}).
-type pubsub_serverinfo_remote_domain() :: #pubsub_serverinfo_remote_domain{}.
Expand Down Expand Up @@ -927,14 +925,6 @@
-record(credentials, {services = [] :: [#service{}]}).
-type credentials() :: #credentials{}.

-record(vcard_email, {home = false :: boolean(),
work = false :: boolean(),
internet = false :: boolean(),
pref = false :: boolean(),
x400 = false :: boolean(),
userid :: 'undefined' | binary()}).
-type vcard_email() :: #vcard_email{}.

-record(block_item, {jid :: jid:jid(),
spam_report :: 'undefined' | #report{}}).
-type block_item() :: #block_item{}.
Expand Down Expand Up @@ -1255,38 +1245,6 @@
suffix :: 'undefined' | binary()}).
-type vcard_name() :: #vcard_name{}.

-record(vcard_temp, {version :: 'undefined' | binary(),
fn :: 'undefined' | binary(),
n :: 'undefined' | #vcard_name{},
nickname :: 'undefined' | binary(),
photo :: 'undefined' | #vcard_photo{},
bday :: 'undefined' | binary(),
adr = [] :: [#vcard_adr{}],
label = [] :: [#vcard_label{}],
tel = [] :: [#vcard_tel{}],
email = [] :: [#vcard_email{}],
jabberid :: 'undefined' | binary(),
mailer :: 'undefined' | binary(),
tz :: 'undefined' | binary(),
geo :: 'undefined' | #vcard_geo{},
title :: 'undefined' | binary(),
role :: 'undefined' | binary(),
logo :: 'undefined' | #vcard_logo{},
org :: 'undefined' | #vcard_org{},
categories = [] :: [binary()],
note :: 'undefined' | binary(),
prodid :: 'undefined' | binary(),
rev :: 'undefined' | binary(),
sort_string :: 'undefined' | binary(),
sound :: 'undefined' | #vcard_sound{},
uid :: 'undefined' | binary(),
url :: 'undefined' | binary(),
class :: 'confidential' | 'private' | 'public' | 'undefined',
key :: 'undefined' | #vcard_key{},
desc :: 'undefined' | binary(),
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
-type vcard_temp() :: #vcard_temp{}.

-record(ibb_data, {sid = <<>> :: binary(),
seq :: non_neg_integer(),
data = <<>> :: binary()}).
Expand Down Expand Up @@ -1338,28 +1296,6 @@
text = [] :: [#text{}]}).
-type sasl_failure() :: #sasl_failure{}.

-record(bind, {jid :: undefined | jid:jid(),
resource = <<>> :: binary()}).
-type bind() :: #bind{}.

-record(jingle_ft_file, {date :: undefined | erlang:timestamp(),
desc = [] :: [#text{}],
hash = [] :: [#hash{}],
'hash-used' :: 'undefined' | #hash_used{},
'media-type' :: 'undefined' | binary(),
name :: 'undefined' | binary(),
size :: 'undefined' | non_neg_integer(),
range :: 'undefined' | #jingle_ft_range{}}).
-type jingle_ft_file() :: #jingle_ft_file{}.

-record(jingle_ft_checksum, {creator :: 'initiator' | 'responder' | 'undefined',
name = <<>> :: binary(),
file :: #jingle_ft_file{}}).
-type jingle_ft_checksum() :: #jingle_ft_checksum{}.

-record(jingle_ft_description, {file :: 'undefined' | #jingle_ft_file{}}).
-type jingle_ft_description() :: #jingle_ft_description{}.

-record(pubsub, {subscriptions :: 'undefined' | {binary(),[#ps_subscription{}]},
subscription :: 'undefined' | #ps_subscription{},
affiliations :: 'undefined' | {binary(),[#ps_affiliation{}]},
Expand Down Expand Up @@ -1400,6 +1336,88 @@
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
-type jingle() :: #jingle{}.

-record(muc_subscription, {jid :: undefined | jid:jid(),
nick = <<>> :: binary(),
events = [] :: [binary()]}).
-type muc_subscription() :: #muc_subscription{}.

-record(muc_subscriptions, {list = [] :: [#muc_subscription{}]}).
-type muc_subscriptions() :: #muc_subscriptions{}.

-record(pubsub_owner, {affiliations :: 'undefined' | {binary(),[#ps_affiliation{}]},
configure :: 'undefined' | {binary(),'undefined' | #xdata{}},
default :: 'undefined' | {binary(),'undefined' | #xdata{}},
delete :: 'undefined' | {binary(),binary()},
purge :: 'undefined' | binary(),
subscriptions :: 'undefined' | {binary(),[#ps_subscription{}]}}).
-type pubsub_owner() :: #pubsub_owner{}.

-record(receipt_request, {}).
-type receipt_request() :: #receipt_request{}.

-record(vcard_email, {home = false :: boolean(),
work = false :: boolean(),
internet = false :: boolean(),
pref = false :: boolean(),
x400 = false :: boolean(),
userid :: 'undefined' | binary()}).
-type vcard_email() :: #vcard_email{}.

-record(vcard_temp, {version :: 'undefined' | binary(),
fn :: 'undefined' | binary(),
n :: 'undefined' | #vcard_name{},
nickname :: 'undefined' | binary(),
photo :: 'undefined' | #vcard_photo{},
bday :: 'undefined' | binary(),
adr = [] :: [#vcard_adr{}],
label = [] :: [#vcard_label{}],
tel = [] :: [#vcard_tel{}],
email = [] :: [#vcard_email{}],
jabberid :: 'undefined' | binary(),
mailer :: 'undefined' | binary(),
tz :: 'undefined' | binary(),
geo :: 'undefined' | #vcard_geo{},
title :: 'undefined' | binary(),
role :: 'undefined' | binary(),
logo :: 'undefined' | #vcard_logo{},
org :: 'undefined' | #vcard_org{},
categories = [] :: [binary()],
note :: 'undefined' | binary(),
prodid :: 'undefined' | binary(),
rev :: 'undefined' | binary(),
sort_string :: 'undefined' | binary(),
sound :: 'undefined' | #vcard_sound{},
uid :: 'undefined' | binary(),
url :: 'undefined' | binary(),
class :: 'confidential' | 'private' | 'public' | 'undefined',
key :: 'undefined' | #vcard_key{},
desc :: 'undefined' | binary(),
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
-type vcard_temp() :: #vcard_temp{}.

-record(privacy_query, {lists = [] :: [#privacy_list{}],
default :: 'none' | 'undefined' | binary(),
active :: 'none' | 'undefined' | binary()}).
-type privacy_query() :: #privacy_query{}.

-record(jingle_ft_file, {date :: undefined | erlang:timestamp(),
desc = [] :: [#text{}],
hash = [] :: [#hash{}],
'hash-used' :: 'undefined' | #hash_used{},
'media-type' :: 'undefined' | binary(),
name :: 'undefined' | binary(),
size :: 'undefined' | non_neg_integer(),
range :: 'undefined' | #jingle_ft_range{}}).
-type jingle_ft_file() :: #jingle_ft_file{}.

-record(jingle_ft_checksum, {creator :: 'initiator' | 'responder' | 'undefined',
name = <<>> :: binary(),
file :: #jingle_ft_file{}}).
-type jingle_ft_checksum() :: #jingle_ft_checksum{}.

-record(jingle_ft_description, {file :: 'undefined' | #jingle_ft_file{}}).
-type jingle_ft_description() :: #jingle_ft_description{}.

-record(register, {registered = false :: boolean(),
remove = false :: boolean(),
instructions :: 'undefined' | binary(),
Expand All @@ -1424,21 +1442,12 @@
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
-type register() :: #register{}.

-record(muc_subscription, {jid :: undefined | jid:jid(),
nick = <<>> :: binary(),
events = [] :: [binary()]}).
-type muc_subscription() :: #muc_subscription{}.

-record(muc_subscriptions, {list = [] :: [#muc_subscription{}]}).
-type muc_subscriptions() :: #muc_subscriptions{}.
-record(bind, {jid :: undefined | jid:jid(),
resource = <<>> :: binary()}).
-type bind() :: #bind{}.

-record(pubsub_owner, {affiliations :: 'undefined' | {binary(),[#ps_affiliation{}]},
configure :: 'undefined' | {binary(),'undefined' | #xdata{}},
default :: 'undefined' | {binary(),'undefined' | #xdata{}},
delete :: 'undefined' | {binary(),binary()},
purge :: 'undefined' | binary(),
subscriptions :: 'undefined' | {binary(),[#ps_subscription{}]}}).
-type pubsub_owner() :: #pubsub_owner{}.
-record(rosterver_feature, {}).
-type rosterver_feature() :: #rosterver_feature{}.

-type xmpp_element() :: address() |
addresses() |
Expand Down Expand Up @@ -1491,7 +1500,9 @@
fasten_apply_to() |
fasten_external() |
feature_csi() |
feature_pre_approval() |
feature_register() |
feature_register_ibr_token() |
feature_sm() |
forwarded() |
gone() |
Expand Down Expand Up @@ -1583,6 +1594,7 @@
origin_id() |
pep_bookmarks_conference() |
ping() |
preauth() |
presence() |
privacy_item() |
privacy_list() |
Expand Down
20 changes: 20 additions & 0 deletions specs/xmpp_codec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@
module = rfc6121,
result = {rosterver_feature}}).

-xml(feature_pre_approval,
#elem{name = <<"sub">>,
xmlns = <<"urn:xmpp:features:pre-approval">>,
module = 'rfc6121',
result = {feature_pre_approval}}).

-xml(privacy_message,
#elem{name = <<"message">>,
xmlns = <<"jabber:iq:privacy">>,
Expand Down Expand Up @@ -5743,6 +5749,20 @@
enc = {enc_enum, []},
dec = {dec_enum, [[incoming, outgoing, bidi]]}}]}).

-xml(preauth,
#elem{name = <<"preauth">>,
xmlns = <<"urn:xmpp:pars:0">>,
module = 'xep0379',
attrs = [#attr{name = <<"token">>,
label = '$token'}],
result = {preauth, '$token'}}).

-xml(feature_register_ibr_token,
#elem{name = <<"register">>,
xmlns = <<"urn:xmpp:ibr-token:0">>,
module = 'xep0445',
result = {feature_register_ibr_token}}).

-spec dec_tzo(_) -> {integer(), integer()}.
dec_tzo(Val) ->
[H1, M1] = binary:split(Val, <<":">>),
Expand Down
Loading