mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-08 21:43:07 +02:00
Change code to reflect recent changes in fxml_gen
This commit is contained in:
parent
b487ccfb34
commit
4ff8d7918a
|
@ -1,7 +1,7 @@
|
||||||
%% Created automatically by XML generator (fxml_gen.erl)
|
%% Created automatically by XML generator (fxml_gen.erl)
|
||||||
%% Source: xmpp_codec.spec
|
%% Source: xmpp_codec.spec
|
||||||
|
|
||||||
-record(vcard_xupdate, {us :: {binary(), binary()},
|
-record(vcard_xupdate, {us = {<<>>, <<>>} :: {binary(), binary()},
|
||||||
hash :: binary()}).
|
hash :: binary()}).
|
||||||
-type vcard_xupdate() :: #vcard_xupdate{}.
|
-type vcard_xupdate() :: #vcard_xupdate{}.
|
||||||
|
|
||||||
|
@ -15,12 +15,12 @@
|
||||||
'no-permanent-store' | 'no-permanent-storage'}).
|
'no-permanent-store' | 'no-permanent-storage'}).
|
||||||
-type hint() :: #hint{}.
|
-type hint() :: #hint{}.
|
||||||
|
|
||||||
-record(iq, {id :: binary(),
|
-record(iq, {id = <<>> :: binary(),
|
||||||
type :: 'error' | 'get' | 'result' | 'set',
|
type :: 'error' | 'get' | 'result' | 'set',
|
||||||
lang :: binary(),
|
lang = <<>> :: binary(),
|
||||||
from :: any(),
|
from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type iq() :: #iq{}.
|
-type iq() :: #iq{}.
|
||||||
|
|
||||||
-record(feature_register, {}).
|
-record(feature_register, {}).
|
||||||
|
@ -31,37 +31,37 @@
|
||||||
-type adhoc_note() :: #adhoc_note{}.
|
-type adhoc_note() :: #adhoc_note{}.
|
||||||
|
|
||||||
-record(address, {type :: 'bcc' | 'cc' | 'noreply' | 'ofrom' | 'replyroom' | 'replyto' | 'to',
|
-record(address, {type :: 'bcc' | 'cc' | 'noreply' | 'ofrom' | 'replyroom' | 'replyto' | 'to',
|
||||||
jid :: any(),
|
jid :: jid:jid(),
|
||||||
desc :: binary(),
|
desc = <<>> :: binary(),
|
||||||
node :: binary(),
|
node = <<>> :: binary(),
|
||||||
delivered :: any()}).
|
delivered :: boolean()}).
|
||||||
-type address() :: #address{}.
|
-type address() :: #address{}.
|
||||||
|
|
||||||
-record(sasl_success, {text :: any()}).
|
-record(sasl_success, {text = <<>> :: binary()}).
|
||||||
-type sasl_success() :: #sasl_success{}.
|
-type sasl_success() :: #sasl_success{}.
|
||||||
|
|
||||||
-record(mam_result, {xmlns :: binary(),
|
-record(mam_result, {xmlns = <<>> :: binary(),
|
||||||
queryid :: binary(),
|
queryid = <<>> :: binary(),
|
||||||
id :: binary(),
|
id = <<>> :: binary(),
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type mam_result() :: #mam_result{}.
|
-type mam_result() :: #mam_result{}.
|
||||||
|
|
||||||
-record(rsm_first, {index :: non_neg_integer(),
|
-record(rsm_first, {index :: non_neg_integer(),
|
||||||
data :: binary()}).
|
data = <<>> :: binary()}).
|
||||||
-type rsm_first() :: #rsm_first{}.
|
-type rsm_first() :: #rsm_first{}.
|
||||||
|
|
||||||
-record(text, {lang :: binary(),
|
-record(text, {lang = <<>> :: binary(),
|
||||||
data :: binary()}).
|
data = <<>> :: binary()}).
|
||||||
-type text() :: #text{}.
|
-type text() :: #text{}.
|
||||||
|
|
||||||
-record(streamhost, {jid :: any(),
|
-record(streamhost, {jid :: jid:jid(),
|
||||||
host :: binary(),
|
host = <<>> :: binary(),
|
||||||
port = 1080 :: non_neg_integer()}).
|
port = 1080 :: non_neg_integer()}).
|
||||||
-type streamhost() :: #streamhost{}.
|
-type streamhost() :: #streamhost{}.
|
||||||
|
|
||||||
-record(sm_resume, {h :: non_neg_integer(),
|
-record(sm_resume, {h :: non_neg_integer(),
|
||||||
previd :: binary(),
|
previd = <<>> :: binary(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sm_resume() :: #sm_resume{}.
|
-type sm_resume() :: #sm_resume{}.
|
||||||
|
|
||||||
-record(carbons_enable, {}).
|
-record(carbons_enable, {}).
|
||||||
|
@ -77,9 +77,9 @@
|
||||||
-record(muc_unsubscribe, {}).
|
-record(muc_unsubscribe, {}).
|
||||||
-type muc_unsubscribe() :: #muc_unsubscribe{}.
|
-type muc_unsubscribe() :: #muc_unsubscribe{}.
|
||||||
|
|
||||||
-record(pubsub_unsubscribe, {node :: binary(),
|
-record(pubsub_unsubscribe, {node = <<>> :: binary(),
|
||||||
jid :: any(),
|
jid :: jid:jid(),
|
||||||
subid :: binary()}).
|
subid = <<>> :: binary()}).
|
||||||
-type pubsub_unsubscribe() :: #pubsub_unsubscribe{}.
|
-type pubsub_unsubscribe() :: #pubsub_unsubscribe{}.
|
||||||
|
|
||||||
-record(mix_leave, {}).
|
-record(mix_leave, {}).
|
||||||
|
@ -88,122 +88,122 @@
|
||||||
-record(ping, {}).
|
-record(ping, {}).
|
||||||
-type ping() :: #ping{}.
|
-type ping() :: #ping{}.
|
||||||
|
|
||||||
-record(delay, {stamp :: any(),
|
-record(delay, {stamp :: erlang:timestamp(),
|
||||||
from :: any(),
|
from :: jid:jid(),
|
||||||
desc = <<>> :: binary()}).
|
desc = <<>> :: binary()}).
|
||||||
-type delay() :: #delay{}.
|
-type delay() :: #delay{}.
|
||||||
|
|
||||||
-record(muc_history, {maxchars :: non_neg_integer(),
|
-record(muc_history, {maxchars :: non_neg_integer(),
|
||||||
maxstanzas :: non_neg_integer(),
|
maxstanzas :: non_neg_integer(),
|
||||||
seconds :: non_neg_integer(),
|
seconds :: non_neg_integer(),
|
||||||
since :: any()}).
|
since :: erlang:timestamp()}).
|
||||||
-type muc_history() :: #muc_history{}.
|
-type muc_history() :: #muc_history{}.
|
||||||
|
|
||||||
-record(thumbnail, {uri :: binary(),
|
-record(thumbnail, {uri = <<>> :: binary(),
|
||||||
'media-type' = <<>> :: binary(),
|
'media-type' = <<>> :: binary(),
|
||||||
width :: non_neg_integer(),
|
width :: non_neg_integer(),
|
||||||
height :: non_neg_integer()}).
|
height :: non_neg_integer()}).
|
||||||
-type thumbnail() :: #thumbnail{}.
|
-type thumbnail() :: #thumbnail{}.
|
||||||
|
|
||||||
-record(pubsub_affiliation, {node :: binary(),
|
-record(pubsub_affiliation, {node = <<>> :: binary(),
|
||||||
type :: 'member' | 'none' | 'outcast' | 'owner' | 'publish-only' | 'publisher'}).
|
type :: 'member' | 'none' | 'outcast' | 'owner' | 'publish-only' | 'publisher'}).
|
||||||
-type pubsub_affiliation() :: #pubsub_affiliation{}.
|
-type pubsub_affiliation() :: #pubsub_affiliation{}.
|
||||||
|
|
||||||
-record(muc_decline, {reason = <<>> :: 'undefined' | binary(),
|
-record(muc_decline, {reason = <<>> :: binary(),
|
||||||
from :: any(),
|
from :: jid:jid(),
|
||||||
to :: any()}).
|
to :: jid:jid()}).
|
||||||
-type muc_decline() :: #muc_decline{}.
|
-type muc_decline() :: #muc_decline{}.
|
||||||
|
|
||||||
-record(sm_a, {h :: non_neg_integer(),
|
-record(sm_a, {h :: non_neg_integer(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sm_a() :: #sm_a{}.
|
-type sm_a() :: #sm_a{}.
|
||||||
|
|
||||||
-record(stream_start, {from :: any(),
|
-record(stream_start, {from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
id = <<>> :: binary(),
|
id = <<>> :: binary(),
|
||||||
version = <<>> :: binary(),
|
version = <<>> :: binary(),
|
||||||
xmlns :: binary(),
|
xmlns = <<>> :: binary(),
|
||||||
stream_xmlns = <<>> :: binary(),
|
stream_xmlns = <<>> :: binary(),
|
||||||
db_xmlns = <<>> :: binary(),
|
db_xmlns = <<>> :: binary(),
|
||||||
lang = <<>> :: binary()}).
|
lang = <<>> :: binary()}).
|
||||||
-type stream_start() :: #stream_start{}.
|
-type stream_start() :: #stream_start{}.
|
||||||
|
|
||||||
-record(muc_subscribe, {nick :: binary(),
|
-record(muc_subscribe, {nick = <<>> :: binary(),
|
||||||
events = [] :: [binary()]}).
|
events = [] :: [binary()]}).
|
||||||
-type muc_subscribe() :: #muc_subscribe{}.
|
-type muc_subscribe() :: #muc_subscribe{}.
|
||||||
|
|
||||||
-record(stanza_id, {by :: any(),
|
-record(stanza_id, {by :: jid:jid(),
|
||||||
id :: binary()}).
|
id = <<>> :: binary()}).
|
||||||
-type stanza_id() :: #stanza_id{}.
|
-type stanza_id() :: #stanza_id{}.
|
||||||
|
|
||||||
-record(starttls_proceed, {}).
|
-record(starttls_proceed, {}).
|
||||||
-type starttls_proceed() :: #starttls_proceed{}.
|
-type starttls_proceed() :: #starttls_proceed{}.
|
||||||
|
|
||||||
-record(client_id, {id :: binary()}).
|
-record(client_id, {id = <<>> :: binary()}).
|
||||||
-type client_id() :: #client_id{}.
|
-type client_id() :: #client_id{}.
|
||||||
|
|
||||||
-record(sm_resumed, {h :: non_neg_integer(),
|
-record(sm_resumed, {h :: non_neg_integer(),
|
||||||
previd :: binary(),
|
previd = <<>> :: binary(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sm_resumed() :: #sm_resumed{}.
|
-type sm_resumed() :: #sm_resumed{}.
|
||||||
|
|
||||||
-record(forwarded, {delay :: #delay{},
|
-record(forwarded, {delay :: #delay{},
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type forwarded() :: #forwarded{}.
|
-type forwarded() :: #forwarded{}.
|
||||||
|
|
||||||
-record(sm_enable, {max :: non_neg_integer(),
|
-record(sm_enable, {max :: non_neg_integer(),
|
||||||
resume = false :: any(),
|
resume = false :: boolean(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sm_enable() :: #sm_enable{}.
|
-type sm_enable() :: #sm_enable{}.
|
||||||
|
|
||||||
-record(starttls_failure, {}).
|
-record(starttls_failure, {}).
|
||||||
-type starttls_failure() :: #starttls_failure{}.
|
-type starttls_failure() :: #starttls_failure{}.
|
||||||
|
|
||||||
-record(sasl_challenge, {text :: any()}).
|
-record(sasl_challenge, {text = <<>> :: binary()}).
|
||||||
-type sasl_challenge() :: #sasl_challenge{}.
|
-type sasl_challenge() :: #sasl_challenge{}.
|
||||||
|
|
||||||
-record(handshake, {data = <<>> :: binary()}).
|
-record(handshake, {data = <<>> :: binary()}).
|
||||||
-type handshake() :: #handshake{}.
|
-type handshake() :: #handshake{}.
|
||||||
|
|
||||||
-record(gone, {uri :: binary()}).
|
-record(gone, {uri = <<>> :: binary()}).
|
||||||
-type gone() :: #gone{}.
|
-type gone() :: #gone{}.
|
||||||
|
|
||||||
-record(x_conference, {jid :: any(),
|
-record(x_conference, {jid :: jid:jid(),
|
||||||
password = <<>> :: binary(),
|
password = <<>> :: binary(),
|
||||||
reason = <<>> :: binary(),
|
reason = <<>> :: binary(),
|
||||||
continue :: any(),
|
continue :: boolean(),
|
||||||
thread = <<>> :: binary()}).
|
thread = <<>> :: binary()}).
|
||||||
-type x_conference() :: #x_conference{}.
|
-type x_conference() :: #x_conference{}.
|
||||||
|
|
||||||
-record(private, {xml_els = [] :: [any()]}).
|
-record(private, {xml_els = [] :: [fxml:xmlel()]}).
|
||||||
-type private() :: #private{}.
|
-type private() :: #private{}.
|
||||||
|
|
||||||
-record(db_verify, {from :: any(),
|
-record(db_verify, {from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
id :: binary(),
|
id = <<>> :: binary(),
|
||||||
type :: 'error' | 'invalid' | 'valid',
|
type :: 'error' | 'invalid' | 'valid',
|
||||||
key = <<>> :: binary(),
|
key = <<>> :: binary(),
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type db_verify() :: #db_verify{}.
|
-type db_verify() :: #db_verify{}.
|
||||||
|
|
||||||
-record(nick, {name :: binary()}).
|
-record(nick, {name = <<>> :: binary()}).
|
||||||
-type nick() :: #nick{}.
|
-type nick() :: #nick{}.
|
||||||
|
|
||||||
-record(p1_ack, {}).
|
-record(p1_ack, {}).
|
||||||
-type p1_ack() :: #p1_ack{}.
|
-type p1_ack() :: #p1_ack{}.
|
||||||
|
|
||||||
-record(feature_sm, {xmlns :: binary()}).
|
-record(feature_sm, {xmlns = <<>> :: binary()}).
|
||||||
-type feature_sm() :: #feature_sm{}.
|
-type feature_sm() :: #feature_sm{}.
|
||||||
|
|
||||||
-record(pubsub_item, {id :: binary(),
|
-record(pubsub_item, {id = <<>> :: binary(),
|
||||||
xml_els = [] :: [any()]}).
|
xml_els = [] :: [fxml:xmlel()]}).
|
||||||
-type pubsub_item() :: #pubsub_item{}.
|
-type pubsub_item() :: #pubsub_item{}.
|
||||||
|
|
||||||
-record(pubsub_publish, {node :: binary(),
|
-record(pubsub_publish, {node = <<>> :: binary(),
|
||||||
items = [] :: [#pubsub_item{}]}).
|
items = [] :: [#pubsub_item{}]}).
|
||||||
-type pubsub_publish() :: #pubsub_publish{}.
|
-type pubsub_publish() :: #pubsub_publish{}.
|
||||||
|
|
||||||
-record(roster_item, {jid :: any(),
|
-record(roster_item, {jid :: jid:jid(),
|
||||||
name = <<>> :: binary(),
|
name = <<>> :: binary(),
|
||||||
groups = [] :: [binary()],
|
groups = [] :: [binary()],
|
||||||
subscription = none :: 'both' | 'from' | 'none' | 'remove' | 'to',
|
subscription = none :: 'both' | 'from' | 'none' | 'remove' | 'to',
|
||||||
|
@ -214,24 +214,24 @@
|
||||||
ver :: binary()}).
|
ver :: binary()}).
|
||||||
-type roster_query() :: #roster_query{}.
|
-type roster_query() :: #roster_query{}.
|
||||||
|
|
||||||
-record(pubsub_event_item, {id :: binary(),
|
-record(pubsub_event_item, {id = <<>> :: binary(),
|
||||||
node :: binary(),
|
node = <<>> :: binary(),
|
||||||
publisher :: binary(),
|
publisher = <<>> :: binary(),
|
||||||
xml_els = [] :: [any()]}).
|
xml_els = [] :: [fxml:xmlel()]}).
|
||||||
-type pubsub_event_item() :: #pubsub_event_item{}.
|
-type pubsub_event_item() :: #pubsub_event_item{}.
|
||||||
|
|
||||||
-record(sm_r, {xmlns :: binary()}).
|
-record(sm_r, {xmlns = <<>> :: binary()}).
|
||||||
-type sm_r() :: #sm_r{}.
|
-type sm_r() :: #sm_r{}.
|
||||||
|
|
||||||
-record(muc_actor, {jid :: any(),
|
-record(muc_actor, {jid :: jid:jid(),
|
||||||
nick :: binary()}).
|
nick = <<>> :: binary()}).
|
||||||
-type muc_actor() :: #muc_actor{}.
|
-type muc_actor() :: #muc_actor{}.
|
||||||
|
|
||||||
-record(stat_error, {code :: integer(),
|
-record(stat_error, {code :: integer(),
|
||||||
reason = <<>> :: binary()}).
|
reason = <<>> :: binary()}).
|
||||||
-type stat_error() :: #stat_error{}.
|
-type stat_error() :: #stat_error{}.
|
||||||
|
|
||||||
-record(stat, {name :: binary(),
|
-record(stat, {name = <<>> :: binary(),
|
||||||
units = <<>> :: binary(),
|
units = <<>> :: binary(),
|
||||||
value = <<>> :: binary(),
|
value = <<>> :: binary(),
|
||||||
error :: #stat_error{}}).
|
error :: #stat_error{}}).
|
||||||
|
@ -240,7 +240,7 @@
|
||||||
-record(addresses, {list = [] :: [#address{}]}).
|
-record(addresses, {list = [] :: [#address{}]}).
|
||||||
-type addresses() :: #addresses{}.
|
-type addresses() :: #addresses{}.
|
||||||
|
|
||||||
-record('see-other-host', {host :: binary()}).
|
-record('see-other-host', {host :: binary() | inet:ip_address() | {binary() | inet:ip_address(),non_neg_integer()}}).
|
||||||
-type 'see-other-host'() :: #'see-other-host'{}.
|
-type 'see-other-host'() :: #'see-other-host'{}.
|
||||||
|
|
||||||
-record(compress, {methods = [] :: [binary()]}).
|
-record(compress, {methods = [] :: [binary()]}).
|
||||||
|
@ -253,17 +253,17 @@
|
||||||
status = <<>> :: binary()}).
|
status = <<>> :: binary()}).
|
||||||
-type last() :: #last{}.
|
-type last() :: #last{}.
|
||||||
|
|
||||||
-record(redirect, {uri :: binary()}).
|
-record(redirect, {uri = <<>> :: binary()}).
|
||||||
-type redirect() :: #redirect{}.
|
-type redirect() :: #redirect{}.
|
||||||
|
|
||||||
-record(sm_enabled, {id :: binary(),
|
-record(sm_enabled, {id = <<>> :: binary(),
|
||||||
location :: binary(),
|
location = <<>> :: binary(),
|
||||||
max :: non_neg_integer(),
|
max :: non_neg_integer(),
|
||||||
resume = false :: any(),
|
resume = false :: boolean(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sm_enabled() :: #sm_enabled{}.
|
-type sm_enabled() :: #sm_enabled{}.
|
||||||
|
|
||||||
-record(pubsub_event_items, {node :: binary(),
|
-record(pubsub_event_items, {node = <<>> :: binary(),
|
||||||
retract = [] :: [binary()],
|
retract = [] :: [binary()],
|
||||||
items = [] :: [#pubsub_event_item{}]}).
|
items = [] :: [#pubsub_event_item{}]}).
|
||||||
-type pubsub_event_items() :: #pubsub_event_items{}.
|
-type pubsub_event_items() :: #pubsub_event_items{}.
|
||||||
|
@ -274,134 +274,134 @@
|
||||||
-record(muc_unique, {name = <<>> :: binary()}).
|
-record(muc_unique, {name = <<>> :: binary()}).
|
||||||
-type muc_unique() :: #muc_unique{}.
|
-type muc_unique() :: #muc_unique{}.
|
||||||
|
|
||||||
-record(sasl_response, {text :: any()}).
|
-record(sasl_response, {text = <<>> :: binary()}).
|
||||||
-type sasl_response() :: #sasl_response{}.
|
-type sasl_response() :: #sasl_response{}.
|
||||||
|
|
||||||
-record(legacy_auth, {username :: 'none' | binary(),
|
-record(legacy_auth, {username :: binary(),
|
||||||
password :: 'none' | binary(),
|
password :: binary(),
|
||||||
digest :: 'none' | binary(),
|
digest :: binary(),
|
||||||
resource :: 'none' | binary()}).
|
resource :: binary()}).
|
||||||
-type legacy_auth() :: #legacy_auth{}.
|
-type legacy_auth() :: #legacy_auth{}.
|
||||||
|
|
||||||
-record(pubsub_subscribe, {node :: binary(),
|
-record(pubsub_subscribe, {node = <<>> :: binary(),
|
||||||
jid :: any()}).
|
jid :: jid:jid()}).
|
||||||
-type pubsub_subscribe() :: #pubsub_subscribe{}.
|
-type pubsub_subscribe() :: #pubsub_subscribe{}.
|
||||||
|
|
||||||
-record(message, {id :: binary(),
|
-record(message, {id = <<>> :: binary(),
|
||||||
type = normal :: 'chat' | 'error' | 'groupchat' | 'headline' | 'normal',
|
type = normal :: 'chat' | 'error' | 'groupchat' | 'headline' | 'normal',
|
||||||
lang :: binary(),
|
lang = <<>> :: binary(),
|
||||||
from :: any(),
|
from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
subject = [] :: [#text{}],
|
subject = [] :: [#text{}],
|
||||||
body = [] :: [#text{}],
|
body = [] :: [#text{}],
|
||||||
thread :: binary(),
|
thread :: binary(),
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type message() :: #message{}.
|
-type message() :: #message{}.
|
||||||
|
|
||||||
-record(sasl_auth, {mechanism :: binary(),
|
-record(sasl_auth, {mechanism = <<>> :: binary(),
|
||||||
text :: any()}).
|
text = <<>> :: binary()}).
|
||||||
-type sasl_auth() :: #sasl_auth{}.
|
-type sasl_auth() :: #sasl_auth{}.
|
||||||
|
|
||||||
-record(p1_push, {}).
|
-record(p1_push, {}).
|
||||||
-type p1_push() :: #p1_push{}.
|
-type p1_push() :: #p1_push{}.
|
||||||
|
|
||||||
-record(feature_csi, {xmlns :: binary()}).
|
-record(feature_csi, {xmlns = <<>> :: binary()}).
|
||||||
-type feature_csi() :: #feature_csi{}.
|
-type feature_csi() :: #feature_csi{}.
|
||||||
|
|
||||||
-record(disco_item, {jid :: any(),
|
-record(disco_item, {jid :: jid:jid(),
|
||||||
name :: binary(),
|
name = <<>> :: binary(),
|
||||||
node :: binary()}).
|
node = <<>> :: binary()}).
|
||||||
-type disco_item() :: #disco_item{}.
|
-type disco_item() :: #disco_item{}.
|
||||||
|
|
||||||
-record(unblock, {items = [] :: [any()]}).
|
-record(unblock, {items = [] :: [jid:jid()]}).
|
||||||
-type unblock() :: #unblock{}.
|
-type unblock() :: #unblock{}.
|
||||||
|
|
||||||
-record(block, {items = [] :: [any()]}).
|
-record(block, {items = [] :: [jid:jid()]}).
|
||||||
-type block() :: #block{}.
|
-type block() :: #block{}.
|
||||||
|
|
||||||
-record(compression, {methods = [] :: [binary()]}).
|
-record(compression, {methods = [] :: [binary()]}).
|
||||||
-type compression() :: #compression{}.
|
-type compression() :: #compression{}.
|
||||||
|
|
||||||
-record(muc_subscriptions, {list = [] :: [any()]}).
|
-record(muc_subscriptions, {list = [] :: [jid:jid()]}).
|
||||||
-type muc_subscriptions() :: #muc_subscriptions{}.
|
-type muc_subscriptions() :: #muc_subscriptions{}.
|
||||||
|
|
||||||
-record(pubsub_subscription, {jid :: any(),
|
-record(pubsub_subscription, {jid :: jid:jid(),
|
||||||
node :: binary(),
|
node = <<>> :: binary(),
|
||||||
subid :: binary(),
|
subid = <<>> :: binary(),
|
||||||
type :: 'none' | 'pending' | 'subscribed' | 'unconfigured'}).
|
type :: 'none' | 'pending' | 'subscribed' | 'unconfigured'}).
|
||||||
-type pubsub_subscription() :: #pubsub_subscription{}.
|
-type pubsub_subscription() :: #pubsub_subscription{}.
|
||||||
|
|
||||||
-record(bob_data, {cid :: binary(),
|
-record(bob_data, {cid = <<>> :: binary(),
|
||||||
'max-age' :: non_neg_integer(),
|
'max-age' :: non_neg_integer(),
|
||||||
type :: binary(),
|
type = <<>> :: binary(),
|
||||||
data = <<>> :: any()}).
|
data = <<>> :: binary()}).
|
||||||
-type bob_data() :: #bob_data{}.
|
-type bob_data() :: #bob_data{}.
|
||||||
|
|
||||||
-record(muc_item, {actor :: #muc_actor{},
|
-record(muc_item, {actor :: #muc_actor{},
|
||||||
continue :: binary(),
|
continue :: binary(),
|
||||||
reason = <<>> :: 'undefined' | binary(),
|
reason = <<>> :: binary(),
|
||||||
affiliation :: 'admin' | 'member' | 'none' | 'outcast' | 'owner',
|
affiliation :: 'admin' | 'member' | 'none' | 'outcast' | 'owner',
|
||||||
role :: 'moderator' | 'none' | 'participant' | 'visitor',
|
role :: 'moderator' | 'none' | 'participant' | 'visitor',
|
||||||
jid :: any(),
|
jid :: jid:jid(),
|
||||||
nick :: binary()}).
|
nick = <<>> :: binary()}).
|
||||||
-type muc_item() :: #muc_item{}.
|
-type muc_item() :: #muc_item{}.
|
||||||
|
|
||||||
-record(muc_admin, {items = [] :: [#muc_item{}]}).
|
-record(muc_admin, {items = [] :: [#muc_item{}]}).
|
||||||
-type muc_admin() :: #muc_admin{}.
|
-type muc_admin() :: #muc_admin{}.
|
||||||
|
|
||||||
-record(shim, {headers = [] :: [{binary(),'undefined' | binary()}]}).
|
-record(shim, {headers = [] :: [{binary(),binary()}]}).
|
||||||
-type shim() :: #shim{}.
|
-type shim() :: #shim{}.
|
||||||
|
|
||||||
-record(mam_prefs, {xmlns :: binary(),
|
-record(mam_prefs, {xmlns = <<>> :: binary(),
|
||||||
default :: 'always' | 'never' | 'roster',
|
default :: 'always' | 'never' | 'roster',
|
||||||
always :: [any()],
|
always :: [jid:jid()],
|
||||||
never :: [any()]}).
|
never :: [jid:jid()]}).
|
||||||
-type mam_prefs() :: #mam_prefs{}.
|
-type mam_prefs() :: #mam_prefs{}.
|
||||||
|
|
||||||
-record(caps, {node :: binary(),
|
-record(caps, {node = <<>> :: binary(),
|
||||||
version :: binary(),
|
version = <<>> :: binary(),
|
||||||
hash :: binary(),
|
hash = <<>> :: binary(),
|
||||||
exts = [] :: any()}).
|
exts = [] :: binary() | []}).
|
||||||
-type caps() :: #caps{}.
|
-type caps() :: #caps{}.
|
||||||
|
|
||||||
-record(muc, {history :: #muc_history{},
|
-record(muc, {history :: #muc_history{},
|
||||||
password :: binary()}).
|
password :: binary()}).
|
||||||
-type muc() :: #muc{}.
|
-type muc() :: #muc{}.
|
||||||
|
|
||||||
-record(stream_features, {sub_els = [] :: [any()]}).
|
-record(stream_features, {sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type stream_features() :: #stream_features{}.
|
-type stream_features() :: #stream_features{}.
|
||||||
|
|
||||||
-record(stats, {list = [] :: [#stat{}],
|
-record(stats, {list = [] :: [#stat{}],
|
||||||
node = <<>> :: binary()}).
|
node = <<>> :: binary()}).
|
||||||
-type stats() :: #stats{}.
|
-type stats() :: #stats{}.
|
||||||
|
|
||||||
-record(pubsub_items, {node :: binary(),
|
-record(pubsub_items, {node = <<>> :: binary(),
|
||||||
max_items :: non_neg_integer(),
|
max_items :: non_neg_integer(),
|
||||||
subid :: binary(),
|
subid = <<>> :: binary(),
|
||||||
items = [] :: [#pubsub_item{}]}).
|
items = [] :: [#pubsub_item{}]}).
|
||||||
-type pubsub_items() :: #pubsub_items{}.
|
-type pubsub_items() :: #pubsub_items{}.
|
||||||
|
|
||||||
-record(presence, {id :: binary(),
|
-record(presence, {id = <<>> :: binary(),
|
||||||
type = available :: 'available' | 'error' | 'probe' | 'subscribe' | 'subscribed' | 'unavailable' | 'unsubscribe' | 'unsubscribed',
|
type = available :: 'available' | 'error' | 'probe' | 'subscribe' | 'subscribed' | 'unavailable' | 'unsubscribe' | 'unsubscribed',
|
||||||
lang :: binary(),
|
lang = <<>> :: binary(),
|
||||||
from :: any(),
|
from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
show :: 'away' | 'chat' | 'dnd' | 'xa',
|
show :: 'away' | 'chat' | 'dnd' | 'xa',
|
||||||
status = [] :: [#text{}],
|
status = [] :: [#text{}],
|
||||||
priority :: integer(),
|
priority :: integer(),
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type presence() :: #presence{}.
|
-type presence() :: #presence{}.
|
||||||
|
|
||||||
-record(sic, {ip :: any(),
|
-record(sic, {ip :: inet:ip_address(),
|
||||||
port :: non_neg_integer(),
|
port :: non_neg_integer(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sic() :: #sic{}.
|
-type sic() :: #sic{}.
|
||||||
|
|
||||||
-record(carbons_sent, {forwarded :: #forwarded{}}).
|
-record(carbons_sent, {forwarded :: #forwarded{}}).
|
||||||
-type carbons_sent() :: #carbons_sent{}.
|
-type carbons_sent() :: #carbons_sent{}.
|
||||||
|
|
||||||
-record(mam_archived, {by :: any(),
|
-record(mam_archived, {by :: jid:jid(),
|
||||||
id :: binary()}).
|
id = <<>> :: binary()}).
|
||||||
-type mam_archived() :: #mam_archived{}.
|
-type mam_archived() :: #mam_archived{}.
|
||||||
|
|
||||||
-record(p1_rebind, {}).
|
-record(p1_rebind, {}).
|
||||||
|
@ -428,28 +428,28 @@
|
||||||
userid :: binary()}).
|
userid :: binary()}).
|
||||||
-type vcard_email() :: #vcard_email{}.
|
-type vcard_email() :: #vcard_email{}.
|
||||||
|
|
||||||
-record(db_result, {from :: any(),
|
-record(db_result, {from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
type :: 'error' | 'invalid' | 'valid',
|
type :: 'error' | 'invalid' | 'valid',
|
||||||
key = <<>> :: binary(),
|
key = <<>> :: binary(),
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type db_result() :: #db_result{}.
|
-type db_result() :: #db_result{}.
|
||||||
|
|
||||||
-record(carbons_received, {forwarded :: #forwarded{}}).
|
-record(carbons_received, {forwarded :: #forwarded{}}).
|
||||||
-type carbons_received() :: #carbons_received{}.
|
-type carbons_received() :: #carbons_received{}.
|
||||||
|
|
||||||
-record(pubsub_retract, {node :: binary(),
|
-record(pubsub_retract, {node = <<>> :: binary(),
|
||||||
notify = false :: any(),
|
notify = false :: boolean(),
|
||||||
items = [] :: [#pubsub_item{}]}).
|
items = [] :: [#pubsub_item{}]}).
|
||||||
-type pubsub_retract() :: #pubsub_retract{}.
|
-type pubsub_retract() :: #pubsub_retract{}.
|
||||||
|
|
||||||
-record(upload_slot, {get :: binary(),
|
-record(upload_slot, {get :: binary(),
|
||||||
put :: binary(),
|
put :: binary(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type upload_slot() :: #upload_slot{}.
|
-type upload_slot() :: #upload_slot{}.
|
||||||
|
|
||||||
-record(mix_participant, {jid :: any(),
|
-record(mix_participant, {jid :: jid:jid(),
|
||||||
nick :: binary()}).
|
nick = <<>> :: binary()}).
|
||||||
-type mix_participant() :: #mix_participant{}.
|
-type mix_participant() :: #mix_participant{}.
|
||||||
|
|
||||||
-record(vcard_geo, {lat :: binary(),
|
-record(vcard_geo, {lat :: binary(),
|
||||||
|
@ -463,27 +463,27 @@
|
||||||
text = [] :: [#text{}]}).
|
text = [] :: [#text{}]}).
|
||||||
-type sasl_failure() :: #sasl_failure{}.
|
-type sasl_failure() :: #sasl_failure{}.
|
||||||
|
|
||||||
-record(block_list, {items = [] :: [any()]}).
|
-record(block_list, {items = [] :: [jid:jid()]}).
|
||||||
-type block_list() :: #block_list{}.
|
-type block_list() :: #block_list{}.
|
||||||
|
|
||||||
-record(upload_request, {filename :: binary(),
|
-record(upload_request, {filename :: binary(),
|
||||||
size :: non_neg_integer(),
|
size :: non_neg_integer(),
|
||||||
'content-type' = <<>> :: binary(),
|
'content-type' = <<>> :: binary(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type upload_request() :: #upload_request{}.
|
-type upload_request() :: #upload_request{}.
|
||||||
|
|
||||||
-record(xdata_option, {label :: binary(),
|
-record(xdata_option, {label = <<>> :: binary(),
|
||||||
value :: binary()}).
|
value :: binary()}).
|
||||||
-type xdata_option() :: #xdata_option{}.
|
-type xdata_option() :: #xdata_option{}.
|
||||||
|
|
||||||
-record(xdata_field, {label :: binary(),
|
-record(xdata_field, {label = <<>> :: binary(),
|
||||||
type :: 'boolean' | 'fixed' | 'hidden' | 'jid-multi' | 'jid-single' | 'list-multi' | 'list-single' | 'text-multi' | 'text-private' | 'text-single',
|
type :: 'boolean' | 'fixed' | 'hidden' | 'jid-multi' | 'jid-single' | 'list-multi' | 'list-single' | 'text-multi' | 'text-private' | 'text-single',
|
||||||
var :: binary(),
|
var = <<>> :: binary(),
|
||||||
required = false :: boolean(),
|
required = false :: boolean(),
|
||||||
desc :: binary(),
|
desc :: binary(),
|
||||||
values = [] :: [binary()],
|
values = [] :: [binary()],
|
||||||
options = [] :: [#xdata_option{}],
|
options = [] :: [#xdata_option{}],
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type xdata_field() :: #xdata_field{}.
|
-type xdata_field() :: #xdata_field{}.
|
||||||
|
|
||||||
-record(version, {name :: binary(),
|
-record(version, {name :: binary(),
|
||||||
|
@ -491,16 +491,16 @@
|
||||||
os :: binary()}).
|
os :: binary()}).
|
||||||
-type version() :: #version{}.
|
-type version() :: #version{}.
|
||||||
|
|
||||||
-record(bind, {jid :: any(),
|
-record(bind, {jid :: jid:jid(),
|
||||||
resource :: any()}).
|
resource :: binary()}).
|
||||||
-type bind() :: #bind{}.
|
-type bind() :: #bind{}.
|
||||||
|
|
||||||
-record(rosterver_feature, {}).
|
-record(rosterver_feature, {}).
|
||||||
-type rosterver_feature() :: #rosterver_feature{}.
|
-type rosterver_feature() :: #rosterver_feature{}.
|
||||||
|
|
||||||
-record(muc_invite, {reason = <<>> :: 'undefined' | binary(),
|
-record(muc_invite, {reason = <<>> :: binary(),
|
||||||
from :: any(),
|
from :: jid:jid(),
|
||||||
to :: any(),
|
to :: jid:jid(),
|
||||||
continue :: binary()}).
|
continue :: binary()}).
|
||||||
-type muc_invite() :: #muc_invite{}.
|
-type muc_invite() :: #muc_invite{}.
|
||||||
|
|
||||||
|
@ -508,11 +508,11 @@
|
||||||
-type carbons_disable() :: #carbons_disable{}.
|
-type carbons_disable() :: #carbons_disable{}.
|
||||||
|
|
||||||
-record(bytestreams, {hosts = [] :: [#streamhost{}],
|
-record(bytestreams, {hosts = [] :: [#streamhost{}],
|
||||||
used :: any(),
|
used :: jid:jid(),
|
||||||
activate :: any(),
|
activate :: jid:jid(),
|
||||||
dstaddr :: binary(),
|
dstaddr = <<>> :: binary(),
|
||||||
mode = tcp :: 'tcp' | 'udp',
|
mode = tcp :: 'tcp' | 'udp',
|
||||||
sid :: binary()}).
|
sid = <<>> :: binary()}).
|
||||||
-type bytestreams() :: #bytestreams{}.
|
-type bytestreams() :: #bytestreams{}.
|
||||||
|
|
||||||
-record(adhoc_actions, {execute :: 'complete' | 'next' | 'prev',
|
-record(adhoc_actions, {execute :: 'complete' | 'next' | 'prev',
|
||||||
|
@ -534,13 +534,13 @@
|
||||||
max :: non_neg_integer()}).
|
max :: non_neg_integer()}).
|
||||||
-type rsm_set() :: #rsm_set{}.
|
-type rsm_set() :: #rsm_set{}.
|
||||||
|
|
||||||
-record(mam_fin, {id :: binary(),
|
-record(mam_fin, {id = <<>> :: binary(),
|
||||||
rsm :: #rsm_set{},
|
rsm :: #rsm_set{},
|
||||||
stable :: any(),
|
stable :: boolean(),
|
||||||
complete :: any()}).
|
complete :: boolean()}).
|
||||||
-type mam_fin() :: #mam_fin{}.
|
-type mam_fin() :: #mam_fin{}.
|
||||||
|
|
||||||
-record(disco_items, {node :: binary(),
|
-record(disco_items, {node = <<>> :: binary(),
|
||||||
items = [] :: [#disco_item{}],
|
items = [] :: [#disco_item{}],
|
||||||
rsm :: #rsm_set{}}).
|
rsm :: #rsm_set{}}).
|
||||||
-type disco_items() :: #disco_items{}.
|
-type disco_items() :: #disco_items{}.
|
||||||
|
@ -561,7 +561,7 @@
|
||||||
number :: binary()}).
|
number :: binary()}).
|
||||||
-type vcard_tel() :: #vcard_tel{}.
|
-type vcard_tel() :: #vcard_tel{}.
|
||||||
|
|
||||||
-record(media_uri, {type :: binary(),
|
-record(media_uri, {type = <<>> :: binary(),
|
||||||
uri = <<>> :: binary()}).
|
uri = <<>> :: binary()}).
|
||||||
-type media_uri() :: #media_uri{}.
|
-type media_uri() :: #media_uri{}.
|
||||||
|
|
||||||
|
@ -570,9 +570,9 @@
|
||||||
uri = [] :: [#media_uri{}]}).
|
uri = [] :: [#media_uri{}]}).
|
||||||
-type media() :: #media{}.
|
-type media() :: #media{}.
|
||||||
|
|
||||||
-record(muc_destroy, {xmlns :: binary(),
|
-record(muc_destroy, {xmlns = <<>> :: binary(),
|
||||||
jid :: any(),
|
jid :: jid:jid(),
|
||||||
reason = <<>> :: 'undefined' | binary(),
|
reason = <<>> :: binary(),
|
||||||
password :: binary()}).
|
password :: binary()}).
|
||||||
-type muc_destroy() :: #muc_destroy{}.
|
-type muc_destroy() :: #muc_destroy{}.
|
||||||
|
|
||||||
|
@ -595,15 +595,15 @@
|
||||||
suffix :: binary()}).
|
suffix :: binary()}).
|
||||||
-type vcard_name() :: #vcard_name{}.
|
-type vcard_name() :: #vcard_name{}.
|
||||||
|
|
||||||
-record(identity, {category :: binary(),
|
-record(identity, {category = <<>> :: binary(),
|
||||||
type :: binary(),
|
type = <<>> :: binary(),
|
||||||
lang :: binary(),
|
lang = <<>> :: binary(),
|
||||||
name :: binary()}).
|
name = <<>> :: binary()}).
|
||||||
-type identity() :: #identity{}.
|
-type identity() :: #identity{}.
|
||||||
|
|
||||||
-record(bookmark_conference, {name :: binary(),
|
-record(bookmark_conference, {name = <<>> :: binary(),
|
||||||
jid :: any(),
|
jid :: jid:jid(),
|
||||||
autojoin = false :: any(),
|
autojoin = false :: boolean(),
|
||||||
nick :: binary(),
|
nick :: binary(),
|
||||||
password :: binary()}).
|
password :: binary()}).
|
||||||
-type bookmark_conference() :: #bookmark_conference{}.
|
-type bookmark_conference() :: #bookmark_conference{}.
|
||||||
|
@ -611,8 +611,8 @@
|
||||||
-record(xmpp_session, {optional = false :: boolean()}).
|
-record(xmpp_session, {optional = false :: boolean()}).
|
||||||
-type xmpp_session() :: #xmpp_session{}.
|
-type xmpp_session() :: #xmpp_session{}.
|
||||||
|
|
||||||
-record(bookmark_url, {name :: binary(),
|
-record(bookmark_url, {name = <<>> :: binary(),
|
||||||
url :: binary()}).
|
url = <<>> :: binary()}).
|
||||||
-type bookmark_url() :: #bookmark_url{}.
|
-type bookmark_url() :: #bookmark_url{}.
|
||||||
|
|
||||||
-record(bookmark_storage, {conference = [] :: [#bookmark_conference{}],
|
-record(bookmark_storage, {conference = [] :: [#bookmark_conference{}],
|
||||||
|
@ -625,12 +625,12 @@
|
||||||
-type oob_x() :: #oob_x{}.
|
-type oob_x() :: #oob_x{}.
|
||||||
|
|
||||||
-record(vcard_sound, {phonetic :: binary(),
|
-record(vcard_sound, {phonetic :: binary(),
|
||||||
binval :: any(),
|
binval :: binary(),
|
||||||
extval :: binary()}).
|
extval :: binary()}).
|
||||||
-type vcard_sound() :: #vcard_sound{}.
|
-type vcard_sound() :: #vcard_sound{}.
|
||||||
|
|
||||||
-record(vcard_photo, {type :: binary(),
|
-record(vcard_photo, {type :: binary(),
|
||||||
binval :: any(),
|
binval :: binary(),
|
||||||
extval :: binary()}).
|
extval :: binary()}).
|
||||||
-type vcard_photo() :: #vcard_photo{}.
|
-type vcard_photo() :: #vcard_photo{}.
|
||||||
|
|
||||||
|
@ -660,7 +660,7 @@
|
||||||
ctry :: binary()}).
|
ctry :: binary()}).
|
||||||
-type vcard_adr() :: #vcard_adr{}.
|
-type vcard_adr() :: #vcard_adr{}.
|
||||||
|
|
||||||
-record(search_item, {jid :: any(),
|
-record(search_item, {jid :: jid:jid(),
|
||||||
first :: binary(),
|
first :: binary(),
|
||||||
last :: binary(),
|
last :: binary(),
|
||||||
nick :: binary(),
|
nick :: binary(),
|
||||||
|
@ -678,11 +678,11 @@
|
||||||
-record(xcaptcha, {xdata :: #xdata{}}).
|
-record(xcaptcha, {xdata :: #xdata{}}).
|
||||||
-type xcaptcha() :: #xcaptcha{}.
|
-type xcaptcha() :: #xcaptcha{}.
|
||||||
|
|
||||||
-record(adhoc_command, {node :: binary(),
|
-record(adhoc_command, {node = <<>> :: binary(),
|
||||||
action = execute :: 'cancel' | 'complete' | 'execute' | 'next' | 'prev',
|
action = execute :: 'cancel' | 'complete' | 'execute' | 'next' | 'prev',
|
||||||
sid :: binary(),
|
sid = <<>> :: binary(),
|
||||||
status :: 'canceled' | 'completed' | 'executing',
|
status :: 'canceled' | 'completed' | 'executing',
|
||||||
lang :: binary(),
|
lang = <<>> :: binary(),
|
||||||
actions :: #adhoc_actions{},
|
actions :: #adhoc_actions{},
|
||||||
notes = [] :: [#adhoc_note{}],
|
notes = [] :: [#adhoc_note{}],
|
||||||
xdata :: #xdata{}}).
|
xdata :: #xdata{}}).
|
||||||
|
@ -697,23 +697,23 @@
|
||||||
xdata :: #xdata{}}).
|
xdata :: #xdata{}}).
|
||||||
-type search() :: #search{}.
|
-type search() :: #search{}.
|
||||||
|
|
||||||
-record(mam_query, {xmlns :: binary(),
|
-record(mam_query, {xmlns = <<>> :: binary(),
|
||||||
id :: binary(),
|
id = <<>> :: binary(),
|
||||||
start :: any(),
|
start :: erlang:timestamp(),
|
||||||
'end' :: any(),
|
'end' :: erlang:timestamp(),
|
||||||
with :: any(),
|
with :: jid:jid(),
|
||||||
withtext :: binary(),
|
withtext :: binary(),
|
||||||
rsm :: #rsm_set{},
|
rsm :: #rsm_set{},
|
||||||
xdata :: #xdata{}}).
|
xdata :: #xdata{}}).
|
||||||
-type mam_query() :: #mam_query{}.
|
-type mam_query() :: #mam_query{}.
|
||||||
|
|
||||||
-record(pubsub_options, {node :: binary(),
|
-record(pubsub_options, {node = <<>> :: binary(),
|
||||||
jid :: any(),
|
jid :: jid:jid(),
|
||||||
subid :: binary(),
|
subid = <<>> :: binary(),
|
||||||
xdata :: #xdata{}}).
|
xdata :: #xdata{}}).
|
||||||
-type pubsub_options() :: #pubsub_options{}.
|
-type pubsub_options() :: #pubsub_options{}.
|
||||||
|
|
||||||
-record(pubsub, {subscriptions :: {'none' | binary(),[#pubsub_subscription{}]},
|
-record(pubsub, {subscriptions :: {binary(),[#pubsub_subscription{}]},
|
||||||
affiliations :: [#pubsub_affiliation{}],
|
affiliations :: [#pubsub_affiliation{}],
|
||||||
publish :: #pubsub_publish{},
|
publish :: #pubsub_publish{},
|
||||||
subscribe :: #pubsub_subscribe{},
|
subscribe :: #pubsub_subscribe{},
|
||||||
|
@ -726,34 +726,34 @@
|
||||||
-record(register, {registered = false :: boolean(),
|
-record(register, {registered = false :: boolean(),
|
||||||
remove = false :: boolean(),
|
remove = false :: boolean(),
|
||||||
instructions :: binary(),
|
instructions :: binary(),
|
||||||
username :: 'none' | binary(),
|
username :: binary(),
|
||||||
nick :: 'none' | binary(),
|
nick :: binary(),
|
||||||
password :: 'none' | binary(),
|
password :: binary(),
|
||||||
name :: 'none' | binary(),
|
name :: binary(),
|
||||||
first :: 'none' | binary(),
|
first :: binary(),
|
||||||
last :: 'none' | binary(),
|
last :: binary(),
|
||||||
email :: 'none' | binary(),
|
email :: binary(),
|
||||||
address :: 'none' | binary(),
|
address :: binary(),
|
||||||
city :: 'none' | binary(),
|
city :: binary(),
|
||||||
state :: 'none' | binary(),
|
state :: binary(),
|
||||||
zip :: 'none' | binary(),
|
zip :: binary(),
|
||||||
phone :: 'none' | binary(),
|
phone :: binary(),
|
||||||
url :: 'none' | binary(),
|
url :: binary(),
|
||||||
date :: 'none' | binary(),
|
date :: binary(),
|
||||||
misc :: 'none' | binary(),
|
misc :: binary(),
|
||||||
text :: 'none' | binary(),
|
text :: binary(),
|
||||||
key :: 'none' | binary(),
|
key :: binary(),
|
||||||
xdata :: #xdata{},
|
xdata :: #xdata{},
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type register() :: #register{}.
|
-type register() :: #register{}.
|
||||||
|
|
||||||
-record(disco_info, {node :: binary(),
|
-record(disco_info, {node = <<>> :: binary(),
|
||||||
identities = [] :: [#identity{}],
|
identities = [] :: [#identity{}],
|
||||||
features = [] :: [binary()],
|
features = [] :: [binary()],
|
||||||
xdata = [] :: [#xdata{}]}).
|
xdata = [] :: [#xdata{}]}).
|
||||||
-type disco_info() :: #disco_info{}.
|
-type disco_info() :: #disco_info{}.
|
||||||
|
|
||||||
-record(offline_item, {node :: binary(),
|
-record(offline_item, {node = <<>> :: binary(),
|
||||||
action :: 'remove' | 'view'}).
|
action :: 'remove' | 'view'}).
|
||||||
-type offline_item() :: #offline_item{}.
|
-type offline_item() :: #offline_item{}.
|
||||||
|
|
||||||
|
@ -772,32 +772,32 @@
|
||||||
|
|
||||||
-record(sm_failed, {reason :: atom() | #gone{} | #redirect{},
|
-record(sm_failed, {reason :: atom() | #gone{} | #redirect{},
|
||||||
h :: non_neg_integer(),
|
h :: non_neg_integer(),
|
||||||
xmlns :: binary()}).
|
xmlns = <<>> :: binary()}).
|
||||||
-type sm_failed() :: #sm_failed{}.
|
-type sm_failed() :: #sm_failed{}.
|
||||||
|
|
||||||
-record(error, {type :: 'auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
-record(error, {type :: 'auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
||||||
code :: non_neg_integer(),
|
code :: non_neg_integer(),
|
||||||
by :: binary(),
|
by = <<>> :: binary(),
|
||||||
reason :: atom() | #gone{} | #redirect{},
|
reason :: atom() | #gone{} | #redirect{},
|
||||||
text :: #text{},
|
text :: #text{},
|
||||||
sub_els = [] :: [any()]}).
|
sub_els = [] :: [xmpp_element() | fxml:xmlel()]}).
|
||||||
-type error() :: #error{}.
|
-type error() :: #error{}.
|
||||||
|
|
||||||
-record(mix_join, {jid :: any(),
|
-record(mix_join, {jid :: jid:jid(),
|
||||||
subscribe = [] :: [binary()]}).
|
subscribe = [] :: [binary()]}).
|
||||||
-type mix_join() :: #mix_join{}.
|
-type mix_join() :: #mix_join{}.
|
||||||
|
|
||||||
-record(privacy_item, {order :: non_neg_integer(),
|
-record(privacy_item, {order :: non_neg_integer(),
|
||||||
action :: 'allow' | 'deny',
|
action :: 'allow' | 'deny',
|
||||||
type :: 'group' | 'jid' | 'subscription',
|
type :: 'group' | 'jid' | 'subscription',
|
||||||
value :: binary(),
|
value = <<>> :: binary(),
|
||||||
message = false :: boolean(),
|
message = false :: boolean(),
|
||||||
iq = false :: boolean(),
|
iq = false :: boolean(),
|
||||||
presence_in = false :: boolean(),
|
presence_in = false :: boolean(),
|
||||||
presence_out = false :: boolean()}).
|
presence_out = false :: boolean()}).
|
||||||
-type privacy_item() :: #privacy_item{}.
|
-type privacy_item() :: #privacy_item{}.
|
||||||
|
|
||||||
-record(privacy_list, {name :: binary(),
|
-record(privacy_list, {name = <<>> :: binary(),
|
||||||
items = [] :: [#privacy_item{}]}).
|
items = [] :: [#privacy_item{}]}).
|
||||||
-type privacy_list() :: #privacy_list{}.
|
-type privacy_list() :: #privacy_list{}.
|
||||||
|
|
||||||
|
@ -811,7 +811,7 @@
|
||||||
-type stream_error() :: #stream_error{}.
|
-type stream_error() :: #stream_error{}.
|
||||||
|
|
||||||
-record(vcard_logo, {type :: binary(),
|
-record(vcard_logo, {type :: binary(),
|
||||||
binval :: any(),
|
binval :: binary(),
|
||||||
extval :: binary()}).
|
extval :: binary()}).
|
||||||
-type vcard_logo() :: #vcard_logo{}.
|
-type vcard_logo() :: #vcard_logo{}.
|
||||||
|
|
||||||
|
@ -846,8 +846,8 @@
|
||||||
desc :: binary()}).
|
desc :: binary()}).
|
||||||
-type vcard_temp() :: #vcard_temp{}.
|
-type vcard_temp() :: #vcard_temp{}.
|
||||||
|
|
||||||
-record(time, {tzo :: any(),
|
-record(time, {tzo :: {integer(),integer()},
|
||||||
utc :: any()}).
|
utc :: erlang:timestamp()}).
|
||||||
-type time() :: #time{}.
|
-type time() :: #time{}.
|
||||||
|
|
||||||
-type xmpp_element() :: muc_admin() |
|
-type xmpp_element() :: muc_admin() |
|
||||||
|
|
|
@ -519,10 +519,10 @@ wait_for_auth(Pkt, StateData) when ?IS_STREAM_MGMT_PACKET(Pkt) ->
|
||||||
wait_for_auth(#iq{type = get,
|
wait_for_auth(#iq{type = get,
|
||||||
sub_els = [#legacy_auth{username = U}]} = IQ, StateData) ->
|
sub_els = [#legacy_auth{username = U}]} = IQ, StateData) ->
|
||||||
Username = case U of
|
Username = case U of
|
||||||
undefined -> none;
|
undefined -> <<"">>;
|
||||||
_ -> U
|
_ -> U
|
||||||
end,
|
end,
|
||||||
Auth = #legacy_auth{username = Username, password = none, resource = none},
|
Auth = #legacy_auth{username = Username, password = <<>>, resource = <<>>},
|
||||||
Res = case ejabberd_auth:plain_password_required(StateData#state.server) of
|
Res = case ejabberd_auth:plain_password_required(StateData#state.server) of
|
||||||
false ->
|
false ->
|
||||||
xmpp:make_iq_result(IQ, Auth#legacy_auth{digest = none});
|
xmpp:make_iq_result(IQ, Auth#legacy_auth{digest = none});
|
||||||
|
|
|
@ -91,7 +91,7 @@ stop(Host) ->
|
||||||
%-------------------------------------------------------------------------
|
%-------------------------------------------------------------------------
|
||||||
|
|
||||||
get_local_commands(Acc, _From,
|
get_local_commands(Acc, _From,
|
||||||
#jid{server = Server, lserver = LServer} = _To, undefined,
|
#jid{server = Server, lserver = LServer} = _To, <<"">>,
|
||||||
Lang) ->
|
Lang) ->
|
||||||
Display = gen_mod:get_module_opt(LServer, ?MODULE,
|
Display = gen_mod:get_module_opt(LServer, ?MODULE,
|
||||||
report_commands_node,
|
report_commands_node,
|
||||||
|
@ -122,7 +122,7 @@ get_local_commands(Acc, _From, _To, _Node, _Lang) ->
|
||||||
%-------------------------------------------------------------------------
|
%-------------------------------------------------------------------------
|
||||||
|
|
||||||
get_sm_commands(Acc, _From,
|
get_sm_commands(Acc, _From,
|
||||||
#jid{lserver = LServer} = To, undefined, Lang) ->
|
#jid{lserver = LServer} = To, <<"">>, Lang) ->
|
||||||
Display = gen_mod:get_module_opt(LServer, ?MODULE,
|
Display = gen_mod:get_module_opt(LServer, ?MODULE,
|
||||||
report_commands_node,
|
report_commands_node,
|
||||||
fun(B) when is_boolean(B) -> B end,
|
fun(B) when is_boolean(B) -> B end,
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
-define(NS_ADMINL(Sub), [<<"http:">>, <<"jabber.org">>, <<"protocol">>,
|
-define(NS_ADMINL(Sub), [<<"http:">>, <<"jabber.org">>, <<"protocol">>,
|
||||||
<<"admin">>, <<Sub>>]).
|
<<"admin">>, <<Sub>>]).
|
||||||
|
|
||||||
tokenize(undefined) -> [];
|
|
||||||
tokenize(Node) -> str:tokens(Node, <<"/#">>).
|
tokenize(Node) -> str:tokens(Node, <<"/#">>).
|
||||||
|
|
||||||
start(Host, Opts) ->
|
start(Host, Opts) ->
|
||||||
|
@ -280,7 +279,7 @@ disco_features(Acc, From, #jid{lserver = LServer} = _To, Node, Lang) ->
|
||||||
{result, Items}
|
{result, Items}
|
||||||
end).
|
end).
|
||||||
|
|
||||||
disco_items(Acc, From, #jid{lserver = LServer, server = Server} = _To, undefined, Lang) ->
|
disco_items(Acc, From, #jid{lserver = LServer, server = Server} = _To, <<"">>, Lang) ->
|
||||||
case gen_mod:is_loaded(LServer, mod_adhoc) of
|
case gen_mod:is_loaded(LServer, mod_adhoc) of
|
||||||
false ->
|
false ->
|
||||||
Acc;
|
Acc;
|
||||||
|
|
|
@ -135,7 +135,7 @@ list_to_blocklist_jids([_ | Items], JIDs) ->
|
||||||
list_to_blocklist_jids(Items, JIDs).
|
list_to_blocklist_jids(Items, JIDs).
|
||||||
|
|
||||||
-spec process_blocklist_block(binary(), binary(), [ljid()],
|
-spec process_blocklist_block(binary(), binary(), [ljid()],
|
||||||
undefined | binary()) ->
|
binary()) ->
|
||||||
{error, error()} |
|
{error, error()} |
|
||||||
{result, undefined, userlist()}.
|
{result, undefined, userlist()}.
|
||||||
process_blocklist_block(LUser, LServer, JIDs, Lang) ->
|
process_blocklist_block(LUser, LServer, JIDs, Lang) ->
|
||||||
|
@ -170,7 +170,7 @@ process_blocklist_block(LUser, LServer, JIDs, Lang) ->
|
||||||
{error, xmpp:err_internal_server_error(<<"Database failure">>, Lang)}
|
{error, xmpp:err_internal_server_error(<<"Database failure">>, Lang)}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_blocklist_unblock_all(binary(), binary(), undefined | binary()) ->
|
-spec process_blocklist_unblock_all(binary(), binary(), binary()) ->
|
||||||
{error, error()} |
|
{error, error()} |
|
||||||
{result, undefined} |
|
{result, undefined} |
|
||||||
{result, undefined, userlist()}.
|
{result, undefined, userlist()}.
|
||||||
|
@ -194,8 +194,7 @@ process_blocklist_unblock_all(LUser, LServer, Lang) ->
|
||||||
{error, xmpp:err_internal_server_error(<<"Database failure">>, Lang)}
|
{error, xmpp:err_internal_server_error(<<"Database failure">>, Lang)}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_blocklist_unblock(binary(), binary(), [ljid()],
|
-spec process_blocklist_unblock(binary(), binary(), [ljid()], binary()) ->
|
||||||
undefined | binary()) ->
|
|
||||||
{error, error()} |
|
{error, error()} |
|
||||||
{result, undefined} |
|
{result, undefined} |
|
||||||
{result, undefined, userlist()}.
|
{result, undefined, userlist()}.
|
||||||
|
@ -243,7 +242,7 @@ broadcast_blocklist_event(LUser, LServer, Event) ->
|
||||||
ejabberd_sm:route(JID, JID,
|
ejabberd_sm:route(JID, JID,
|
||||||
{broadcast, {blocking, Event}}).
|
{broadcast, {blocking, Event}}).
|
||||||
|
|
||||||
-spec process_blocklist_get(binary(), binary(), undefined | binary()) ->
|
-spec process_blocklist_get(binary(), binary(), binary()) ->
|
||||||
{error, error()} | {result, block_list()}.
|
{error, error()} | {result, block_list()}.
|
||||||
process_blocklist_get(LUser, LServer, Lang) ->
|
process_blocklist_get(LUser, LServer, Lang) ->
|
||||||
Mod = db_mod(LServer),
|
Mod = db_mod(LServer),
|
||||||
|
|
|
@ -35,8 +35,6 @@
|
||||||
|
|
||||||
-behaviour(gen_mod).
|
-behaviour(gen_mod).
|
||||||
|
|
||||||
-compile(export_all).
|
|
||||||
|
|
||||||
-export([read_caps/1, caps_stream_features/2,
|
-export([read_caps/1, caps_stream_features/2,
|
||||||
disco_features/5, disco_identity/5, disco_info/5,
|
disco_features/5, disco_identity/5, disco_info/5,
|
||||||
get_features/2, export/1, import_info/0, import/5,
|
get_features/2, export/1, import_info/0, import/5,
|
||||||
|
@ -162,38 +160,38 @@ caps_stream_features(Acc, MyHost) ->
|
||||||
|
|
||||||
-spec disco_features({error, error()} | {result, [binary()]} | empty,
|
-spec disco_features({error, error()} | {result, [binary()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(),
|
||||||
undefined | binary(), undefined | binary()) ->
|
binary(), binary()) ->
|
||||||
{error, error()} | {result, [binary()]}.
|
{error, error()} | {result, [binary()]}.
|
||||||
disco_features(Acc, From, To, Node, Lang) ->
|
disco_features(Acc, From, To, Node, Lang) ->
|
||||||
case is_valid_node(Node) of
|
case is_valid_node(Node) of
|
||||||
true ->
|
true ->
|
||||||
ejabberd_hooks:run_fold(disco_local_features,
|
ejabberd_hooks:run_fold(disco_local_features,
|
||||||
To#jid.lserver, empty,
|
To#jid.lserver, empty,
|
||||||
[From, To, undefined, Lang]);
|
[From, To, <<"">>, Lang]);
|
||||||
false ->
|
false ->
|
||||||
Acc
|
Acc
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec disco_identity([identity()], jid(), jid(),
|
-spec disco_identity([identity()], jid(), jid(),
|
||||||
undefined | binary(), undefined | binary()) ->
|
binary(), binary()) ->
|
||||||
[identity()].
|
[identity()].
|
||||||
disco_identity(Acc, From, To, Node, Lang) ->
|
disco_identity(Acc, From, To, Node, Lang) ->
|
||||||
case is_valid_node(Node) of
|
case is_valid_node(Node) of
|
||||||
true ->
|
true ->
|
||||||
ejabberd_hooks:run_fold(disco_local_identity,
|
ejabberd_hooks:run_fold(disco_local_identity,
|
||||||
To#jid.lserver, [],
|
To#jid.lserver, [],
|
||||||
[From, To, undefined, Lang]);
|
[From, To, <<"">>, Lang]);
|
||||||
false ->
|
false ->
|
||||||
Acc
|
Acc
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec disco_info([xdata()], binary(), module(),
|
-spec disco_info([xdata()], binary(), module(),
|
||||||
undefined | binary(), undefined | binary()) -> [xdata()].
|
binary(), binary()) -> [xdata()].
|
||||||
disco_info(Acc, Host, Module, Node, Lang) ->
|
disco_info(Acc, Host, Module, Node, Lang) ->
|
||||||
case is_valid_node(Node) of
|
case is_valid_node(Node) of
|
||||||
true ->
|
true ->
|
||||||
ejabberd_hooks:run_fold(disco_info, Host, [],
|
ejabberd_hooks:run_fold(disco_info, Host, [],
|
||||||
[Host, Module, undefined, Lang]);
|
[Host, Module, <<"">>, Lang]);
|
||||||
false ->
|
false ->
|
||||||
Acc
|
Acc
|
||||||
end.
|
end.
|
||||||
|
@ -485,7 +483,7 @@ concat_info(#disco_info{xdata = Xs}) ->
|
||||||
[concat_xdata_fields(Fs) || #xdata{type = result, fields = Fs} <- Xs]).
|
[concat_xdata_fields(Fs) || #xdata{type = result, fields = Fs} <- Xs]).
|
||||||
|
|
||||||
concat_xdata_fields(Fields) ->
|
concat_xdata_fields(Fields) ->
|
||||||
Form = case lists:keysearch(<<"FORM_TYPE">>, #xdata_field.var, Fields) of
|
Form = case lists:keyfind(<<"FORM_TYPE">>, #xdata_field.var, Fields) of
|
||||||
#xdata_field{values = Values} -> Values;
|
#xdata_field{values = Values} -> Values;
|
||||||
false -> []
|
false -> []
|
||||||
end,
|
end,
|
||||||
|
@ -509,9 +507,7 @@ gb_trees_fold_iter(F, Acc, Iter) ->
|
||||||
now_ts() ->
|
now_ts() ->
|
||||||
p1_time_compat:system_time(seconds).
|
p1_time_compat:system_time(seconds).
|
||||||
|
|
||||||
-spec is_valid_node(undefined | binary()) -> boolean().
|
-spec is_valid_node(binary()) -> boolean().
|
||||||
is_valid_node(undefined) ->
|
|
||||||
false;
|
|
||||||
is_valid_node(Node) ->
|
is_valid_node(Node) ->
|
||||||
case str:tokens(Node, <<"#">>) of
|
case str:tokens(Node, <<"#">>) of
|
||||||
[?EJABBERD_URI|_] ->
|
[?EJABBERD_URI|_] ->
|
||||||
|
|
|
@ -121,7 +121,6 @@ depends(_Host, _Opts) ->
|
||||||
[<<"http:">>, <<"jabber.org">>, <<"protocol">>,
|
[<<"http:">>, <<"jabber.org">>, <<"protocol">>,
|
||||||
<<"admin">>, Sub]).
|
<<"admin">>, Sub]).
|
||||||
|
|
||||||
tokenize(undefined) -> [];
|
|
||||||
tokenize(Node) -> str:tokens(Node, <<"/#">>).
|
tokenize(Node) -> str:tokens(Node, <<"/#">>).
|
||||||
|
|
||||||
get_sm_identity(Acc, _From, _To, Node, Lang) ->
|
get_sm_identity(Acc, _From, _To, Node, Lang) ->
|
||||||
|
@ -300,7 +299,7 @@ get_sm_items(Acc, From,
|
||||||
empty -> []
|
empty -> []
|
||||||
end,
|
end,
|
||||||
case {acl:match_rule(LServer, configure, From), Node} of
|
case {acl:match_rule(LServer, configure, From), Node} of
|
||||||
{allow, undefined} ->
|
{allow, <<"">>} ->
|
||||||
Nodes = [?NODEJID(To, <<"Configuration">>,
|
Nodes = [?NODEJID(To, <<"Configuration">>,
|
||||||
<<"config">>),
|
<<"config">>),
|
||||||
?NODEJID(To, <<"User Management">>, <<"user">>)],
|
?NODEJID(To, <<"User Management">>, <<"user">>)],
|
||||||
|
@ -399,7 +398,7 @@ get_permission_level(JID) ->
|
||||||
end).
|
end).
|
||||||
|
|
||||||
get_local_items(Acc, From, #jid{lserver = LServer} = To,
|
get_local_items(Acc, From, #jid{lserver = LServer} = To,
|
||||||
undefined, Lang) ->
|
<<"">>, Lang) ->
|
||||||
case gen_mod:is_loaded(LServer, mod_adhoc) of
|
case gen_mod:is_loaded(LServer, mod_adhoc) of
|
||||||
false -> Acc;
|
false -> Acc;
|
||||||
_ ->
|
_ ->
|
||||||
|
|
|
@ -190,9 +190,8 @@ process_local_iq_info(#iq{type = get, lang = Lang,
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec get_local_identity([identity()], jid(), jid(),
|
-spec get_local_identity([identity()], jid(), jid(),
|
||||||
undefined | binary(), undefined | binary()) ->
|
binary(), binary()) -> [identity()].
|
||||||
[identity()].
|
get_local_identity(Acc, _From, _To, <<"">>, _Lang) ->
|
||||||
get_local_identity(Acc, _From, _To, undefined, _Lang) ->
|
|
||||||
Acc ++ [#identity{category = <<"server">>,
|
Acc ++ [#identity{category = <<"server">>,
|
||||||
type = <<"im">>,
|
type = <<"im">>,
|
||||||
name = <<"ejabberd">>}];
|
name = <<"ejabberd">>}];
|
||||||
|
@ -200,13 +199,12 @@ get_local_identity(Acc, _From, _To, _Node, _Lang) ->
|
||||||
Acc.
|
Acc.
|
||||||
|
|
||||||
-spec get_local_features({error, error()} | {result, [binary()]} | empty,
|
-spec get_local_features({error, error()} | {result, [binary()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(), binary(), binary()) ->
|
||||||
undefined | binary(), undefined | binary()) ->
|
|
||||||
{error, error()} | {result, [binary()]}.
|
{error, error()} | {result, [binary()]}.
|
||||||
get_local_features({error, _Error} = Acc, _From, _To,
|
get_local_features({error, _Error} = Acc, _From, _To,
|
||||||
_Node, _Lang) ->
|
_Node, _Lang) ->
|
||||||
Acc;
|
Acc;
|
||||||
get_local_features(Acc, _From, To, undefined, _Lang) ->
|
get_local_features(Acc, _From, To, <<"">>, _Lang) ->
|
||||||
Feats = case Acc of
|
Feats = case Acc of
|
||||||
{result, Features} -> Features;
|
{result, Features} -> Features;
|
||||||
empty -> []
|
empty -> []
|
||||||
|
@ -226,12 +224,12 @@ get_local_features(Acc, _From, _To, _Node, Lang) ->
|
||||||
|
|
||||||
-spec get_local_services({error, error()} | {result, [disco_item()]} | empty,
|
-spec get_local_services({error, error()} | {result, [disco_item()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(),
|
||||||
undefined | binary(), undefined | binary()) ->
|
binary(), binary()) ->
|
||||||
{error, error()} | {result, [disco_item()]}.
|
{error, error()} | {result, [disco_item()]}.
|
||||||
get_local_services({error, _Error} = Acc, _From, _To,
|
get_local_services({error, _Error} = Acc, _From, _To,
|
||||||
_Node, _Lang) ->
|
_Node, _Lang) ->
|
||||||
Acc;
|
Acc;
|
||||||
get_local_services(Acc, _From, To, undefined, _Lang) ->
|
get_local_services(Acc, _From, To, <<"">>, _Lang) ->
|
||||||
Items = case Acc of
|
Items = case Acc of
|
||||||
{result, Its} -> Its;
|
{result, Its} -> Its;
|
||||||
empty -> []
|
empty -> []
|
||||||
|
@ -300,13 +298,13 @@ process_sm_iq_items(#iq{type = get, lang = Lang,
|
||||||
|
|
||||||
-spec get_sm_items({error, error()} | {result, [disco_item()]} | empty,
|
-spec get_sm_items({error, error()} | {result, [disco_item()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(),
|
||||||
undefined | binary(), undefined | binary()) ->
|
binary(), binary()) ->
|
||||||
{error, error()} | {result, [disco_item()]}.
|
{error, error()} | {result, [disco_item()]}.
|
||||||
get_sm_items({error, _Error} = Acc, _From, _To, _Node,
|
get_sm_items({error, _Error} = Acc, _From, _To, _Node,
|
||||||
_Lang) ->
|
_Lang) ->
|
||||||
Acc;
|
Acc;
|
||||||
get_sm_items(Acc, From,
|
get_sm_items(Acc, From,
|
||||||
#jid{user = User, server = Server} = To, undefined, _Lang) ->
|
#jid{user = User, server = Server} = To, <<"">>, _Lang) ->
|
||||||
Items = case Acc of
|
Items = case Acc of
|
||||||
{result, Its} -> Its;
|
{result, Its} -> Its;
|
||||||
empty -> []
|
empty -> []
|
||||||
|
@ -375,8 +373,7 @@ process_sm_iq_info(#iq{type = get, lang = Lang,
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec get_sm_identity([identity()], jid(), jid(),
|
-spec get_sm_identity([identity()], jid(), jid(),
|
||||||
undefined | binary(), undefined | binary()) ->
|
binary(), binary()) -> [identity()].
|
||||||
[identity()].
|
|
||||||
get_sm_identity(Acc, _From,
|
get_sm_identity(Acc, _From,
|
||||||
#jid{luser = LUser, lserver = LServer}, _Node, _Lang) ->
|
#jid{luser = LUser, lserver = LServer}, _Node, _Lang) ->
|
||||||
Acc ++
|
Acc ++
|
||||||
|
@ -387,8 +384,7 @@ get_sm_identity(Acc, _From,
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec get_sm_features({error, error()} | {result, [binary()]} | empty,
|
-spec get_sm_features({error, error()} | {result, [binary()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(), binary(), binary()) ->
|
||||||
undefined | binary(), undefined | binary()) ->
|
|
||||||
{error, error()} | {result, [binary()]}.
|
{error, error()} | {result, [binary()]}.
|
||||||
get_sm_features(empty, From, To, _Node, Lang) ->
|
get_sm_features(empty, From, To, _Node, Lang) ->
|
||||||
#jid{luser = LFrom, lserver = LSFrom} = From,
|
#jid{luser = LFrom, lserver = LSFrom} = From,
|
||||||
|
@ -428,10 +424,8 @@ transform_module_options(Opts) ->
|
||||||
|
|
||||||
%%% Support for: XEP-0157 Contact Addresses for XMPP Services
|
%%% Support for: XEP-0157 Contact Addresses for XMPP Services
|
||||||
|
|
||||||
-spec get_info([xdata()], binary(), module(),
|
-spec get_info([xdata()], binary(), module(), binary(), binary()) -> [xdata()].
|
||||||
undefined | binary(), undefined | binary()) ->
|
get_info(_A, Host, Mod, Node, _Lang) when Node == <<"">> ->
|
||||||
[xdata()].
|
|
||||||
get_info(_A, Host, Mod, Node, _Lang) when Node == undefined ->
|
|
||||||
Module = case Mod of
|
Module = case Mod of
|
||||||
undefined -> ?MODULE;
|
undefined -> ?MODULE;
|
||||||
_ -> Mod
|
_ -> Mod
|
||||||
|
|
|
@ -257,7 +257,7 @@ process_disco_items(#iq{type = set, lang = Lang} = IQ) ->
|
||||||
process_disco_items(#iq{type = get, lang = Lang, to = To,
|
process_disco_items(#iq{type = get, lang = Lang, to = To,
|
||||||
sub_els = [#disco_items{node = Node}]} = IQ) ->
|
sub_els = [#disco_items{node = Node}]} = IQ) ->
|
||||||
case Node of
|
case Node of
|
||||||
undefined ->
|
<<"">> ->
|
||||||
xmpp:make_iq_result(IQ, #disco_items{});
|
xmpp:make_iq_result(IQ, #disco_items{});
|
||||||
<<"join">> ->
|
<<"join">> ->
|
||||||
xmpp:make_iq_result(IQ, #disco_items{});
|
xmpp:make_iq_result(IQ, #disco_items{});
|
||||||
|
@ -401,7 +401,7 @@ sm_route(Host, ServerHost, From, To, Packet) ->
|
||||||
closed_connection(Host, From, Server) ->
|
closed_connection(Host, From, Server) ->
|
||||||
ets:delete(irc_connection, {From, Server, Host}).
|
ets:delete(irc_connection, {From, Server, Host}).
|
||||||
|
|
||||||
iq_disco(_ServerHost, undefined, Lang) ->
|
iq_disco(_ServerHost, <<"">>, Lang) ->
|
||||||
#disco_info{
|
#disco_info{
|
||||||
identities = [#identity{category = <<"conference">>,
|
identities = [#identity{category = <<"conference">>,
|
||||||
type = <<"irc">>,
|
type = <<"irc">>,
|
||||||
|
|
|
@ -363,7 +363,7 @@ disco_sm_features(empty, From, To, Node, Lang) ->
|
||||||
disco_sm_features({result, []}, From, To, Node, Lang);
|
disco_sm_features({result, []}, From, To, Node, Lang);
|
||||||
disco_sm_features({result, OtherFeatures},
|
disco_sm_features({result, OtherFeatures},
|
||||||
#jid{luser = U, lserver = S},
|
#jid{luser = U, lserver = S},
|
||||||
#jid{luser = U, lserver = S}, undefined, _Lang) ->
|
#jid{luser = U, lserver = S}, <<"">>, _Lang) ->
|
||||||
{result, [?NS_MAM_TMP, ?NS_MAM_0, ?NS_MAM_1 | OtherFeatures]};
|
{result, [?NS_MAM_TMP, ?NS_MAM_0, ?NS_MAM_1 | OtherFeatures]};
|
||||||
disco_sm_features(Acc, _From, _To, _Node, _Lang) ->
|
disco_sm_features(Acc, _From, _To, _Node, _Lang) ->
|
||||||
Acc.
|
Acc.
|
||||||
|
|
|
@ -450,10 +450,10 @@ process_disco_info(#iq{type = set, lang = Lang} = IQ) ->
|
||||||
Txt = <<"Value 'set' of 'type' attribute is not allowed">>,
|
Txt = <<"Value 'set' of 'type' attribute is not allowed">>,
|
||||||
xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
|
xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
|
||||||
process_disco_info(#iq{type = get, to = To, lang = Lang,
|
process_disco_info(#iq{type = get, to = To, lang = Lang,
|
||||||
sub_els = [#disco_info{node = undefined}]} = IQ) ->
|
sub_els = [#disco_info{node = <<"">>}]} = IQ) ->
|
||||||
ServerHost = ejabberd_router:host_of_route(To#jid.lserver),
|
ServerHost = ejabberd_router:host_of_route(To#jid.lserver),
|
||||||
X = ejabberd_hooks:run_fold(disco_info, ServerHost, [],
|
X = ejabberd_hooks:run_fold(disco_info, ServerHost, [],
|
||||||
[ServerHost, ?MODULE, undefined, Lang]),
|
[ServerHost, ?MODULE, <<"">>, Lang]),
|
||||||
MAMFeatures = case gen_mod:is_loaded(ServerHost, mod_mam) of
|
MAMFeatures = case gen_mod:is_loaded(ServerHost, mod_mam) of
|
||||||
true -> [?NS_MAM_TMP, ?NS_MAM_0, ?NS_MAM_1];
|
true -> [?NS_MAM_TMP, ?NS_MAM_0, ?NS_MAM_1];
|
||||||
false -> []
|
false -> []
|
||||||
|
@ -562,7 +562,7 @@ register_room(Host, Room, Pid) ->
|
||||||
end,
|
end,
|
||||||
mnesia:transaction(F).
|
mnesia:transaction(F).
|
||||||
|
|
||||||
iq_disco_items(Host, From, Lang, undefined, undefined) ->
|
iq_disco_items(Host, From, Lang, <<"">>, undefined) ->
|
||||||
Rooms = get_vh_rooms(Host),
|
Rooms = get_vh_rooms(Host),
|
||||||
case erlang:length(Rooms) < ?MAX_ROOMS_DISCOITEMS of
|
case erlang:length(Rooms) < ?MAX_ROOMS_DISCOITEMS of
|
||||||
true ->
|
true ->
|
||||||
|
|
|
@ -277,7 +277,7 @@ normal_state({route, From, <<"">>,
|
||||||
process_iq_admin(From, IQ, StateData);
|
process_iq_admin(From, IQ, StateData);
|
||||||
?NS_MUC_OWNER ->
|
?NS_MUC_OWNER ->
|
||||||
process_iq_owner(From, IQ, StateData);
|
process_iq_owner(From, IQ, StateData);
|
||||||
?NS_DISCO_INFO when SubEl#disco_info.node == undefined ->
|
?NS_DISCO_INFO when SubEl#disco_info.node == <<>> ->
|
||||||
process_iq_disco_info(From, IQ, StateData);
|
process_iq_disco_info(From, IQ, StateData);
|
||||||
?NS_DISCO_INFO ->
|
?NS_DISCO_INFO ->
|
||||||
Txt = <<"Disco info is not available for this node">>,
|
Txt = <<"Disco info is not available for this node">>,
|
||||||
|
@ -2146,11 +2146,7 @@ send_new_presence1(NJID, Reason, IsInitialPresence, StateData, OldStateData) ->
|
||||||
true -> Item0#muc_item{jid = RealJID};
|
true -> Item0#muc_item{jid = RealJID};
|
||||||
false -> Item0
|
false -> Item0
|
||||||
end,
|
end,
|
||||||
Item = if is_binary(Reason), Reason /= <<"">> ->
|
Item = Item1#muc_item{reason = Reason},
|
||||||
Item1#muc_item{reason = Reason};
|
|
||||||
true ->
|
|
||||||
Item1
|
|
||||||
end,
|
|
||||||
StatusCodes = status_codes(IsInitialPresence, NJID, Info,
|
StatusCodes = status_codes(IsInitialPresence, NJID, Info,
|
||||||
StateData),
|
StateData),
|
||||||
Pres = if Presence == undefined -> #presence{};
|
Pres = if Presence == undefined -> #presence{};
|
||||||
|
@ -2526,11 +2522,7 @@ items_with_affiliation(SAffiliation, StateData) ->
|
||||||
lists:map(
|
lists:map(
|
||||||
fun({JID, {Affiliation, Reason}}) ->
|
fun({JID, {Affiliation, Reason}}) ->
|
||||||
#muc_item{affiliation = Affiliation, jid = JID,
|
#muc_item{affiliation = Affiliation, jid = JID,
|
||||||
reason = if is_binary(Reason), Reason /= <<"">> ->
|
reason = Reason};
|
||||||
Reason;
|
|
||||||
true ->
|
|
||||||
undefined
|
|
||||||
end};
|
|
||||||
({JID, Affiliation}) ->
|
({JID, Affiliation}) ->
|
||||||
#muc_item{affiliation = Affiliation, jid = JID}
|
#muc_item{affiliation = Affiliation, jid = JID}
|
||||||
end,
|
end,
|
||||||
|
@ -2563,7 +2555,7 @@ search_affiliation(Affiliation, StateData) ->
|
||||||
end,
|
end,
|
||||||
(?DICT):to_list(StateData#state.affiliations)).
|
(?DICT):to_list(StateData#state.affiliations)).
|
||||||
|
|
||||||
-spec process_admin_items_set(jid(), [muc_item()], binary() | undefined,
|
-spec process_admin_items_set(jid(), [muc_item()], binary(),
|
||||||
#state{}) -> {result, undefined, #state{}} |
|
#state{}) -> {result, undefined, #state{}} |
|
||||||
{error, error()}.
|
{error, error()}.
|
||||||
process_admin_items_set(UJID, Items, Lang, StateData) ->
|
process_admin_items_set(UJID, Items, Lang, StateData) ->
|
||||||
|
@ -2666,13 +2658,13 @@ find_changed_items(_UJID, _UAffiliation, _URole,
|
||||||
Txt = <<"Neither 'role' nor 'affiliation' attribute found">>,
|
Txt = <<"Neither 'role' nor 'affiliation' attribute found">>,
|
||||||
throw({error, xmpp:err_bad_request(Txt, Lang)});
|
throw({error, xmpp:err_bad_request(Txt, Lang)});
|
||||||
find_changed_items(UJID, UAffiliation, URole,
|
find_changed_items(UJID, UAffiliation, URole,
|
||||||
[#muc_item{jid = J, nick = Nick, reason = Reason0,
|
[#muc_item{jid = J, nick = Nick, reason = Reason,
|
||||||
role = Role, affiliation = Affiliation}|Items],
|
role = Role, affiliation = Affiliation}|Items],
|
||||||
Lang, StateData, Res) ->
|
Lang, StateData, Res) ->
|
||||||
[JID | _] = JIDs =
|
[JID | _] = JIDs =
|
||||||
if J /= undefined ->
|
if J /= undefined ->
|
||||||
[J];
|
[J];
|
||||||
Nick /= undefined ->
|
Nick /= <<"">> ->
|
||||||
case find_jids_by_nick(Nick, StateData) of
|
case find_jids_by_nick(Nick, StateData) of
|
||||||
[] ->
|
[] ->
|
||||||
ErrText = iolist_to_binary(
|
ErrText = iolist_to_binary(
|
||||||
|
@ -2717,9 +2709,6 @@ find_changed_items(UJID, UAffiliation, URole,
|
||||||
Items, Lang, StateData,
|
Items, Lang, StateData,
|
||||||
Res);
|
Res);
|
||||||
true ->
|
true ->
|
||||||
Reason = if is_binary(Reason0) -> Reason0;
|
|
||||||
true -> <<"">>
|
|
||||||
end,
|
|
||||||
MoreRes = [{jid:remove_resource(Jidx),
|
MoreRes = [{jid:remove_resource(Jidx),
|
||||||
RoleOrAff, RoleOrAffValue, Reason}
|
RoleOrAff, RoleOrAffValue, Reason}
|
||||||
|| Jidx <- JIDs],
|
|| Jidx <- JIDs],
|
||||||
|
@ -2914,11 +2903,7 @@ send_kickban_presence1(MJID, UJID, Reason, Code, Affiliation,
|
||||||
true -> Item0#muc_item{jid = RealJID};
|
true -> Item0#muc_item{jid = RealJID};
|
||||||
false -> Item0
|
false -> Item0
|
||||||
end,
|
end,
|
||||||
Item2 = if is_binary(Reason), Reason /= <<"">> ->
|
Item2 = Item1#muc_item{reason = Reason},
|
||||||
Item1#muc_item{reason = Reason};
|
|
||||||
true ->
|
|
||||||
Item1
|
|
||||||
end,
|
|
||||||
Item = case ActorNick of
|
Item = case ActorNick of
|
||||||
<<"">> -> Item2;
|
<<"">> -> Item2;
|
||||||
_ -> Item2#muc_item{actor = #muc_actor{nick = ActorNick}}
|
_ -> Item2#muc_item{actor = #muc_actor{nick = ActorNick}}
|
||||||
|
|
|
@ -250,7 +250,7 @@ receive_all(US, Msgs, DBType) ->
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
get_sm_features(Acc, _From, _To, undefined, _Lang) ->
|
get_sm_features(Acc, _From, _To, <<"">>, _Lang) ->
|
||||||
Feats = case Acc of
|
Feats = case Acc of
|
||||||
{result, I} -> I;
|
{result, I} -> I;
|
||||||
_ -> []
|
_ -> []
|
||||||
|
@ -297,8 +297,7 @@ get_sm_items(_Acc, #jid{luser = U, lserver = S, lresource = R} = JID,
|
||||||
get_sm_items(Acc, _From, _To, _Node, _Lang) ->
|
get_sm_items(Acc, _From, _To, _Node, _Lang) ->
|
||||||
Acc.
|
Acc.
|
||||||
|
|
||||||
-spec get_info([xdata()], jid(), jid(),
|
-spec get_info([xdata()], jid(), jid(), binary(), binary()) -> [xdata()].
|
||||||
undefined | binary(), undefined | binary()) -> [xdata()].
|
|
||||||
get_info(_Acc, #jid{luser = U, lserver = S, lresource = R},
|
get_info(_Acc, #jid{luser = U, lserver = S, lresource = R},
|
||||||
#jid{luser = U, lserver = S}, ?NS_FLEX_OFFLINE, _Lang) ->
|
#jid{luser = U, lserver = S}, ?NS_FLEX_OFFLINE, _Lang) ->
|
||||||
N = jlib:integer_to_binary(count_offline_messages(U, S)),
|
N = jlib:integer_to_binary(count_offline_messages(U, S)),
|
||||||
|
|
|
@ -116,7 +116,7 @@ process_iq_get(_, #iq{from = From, lang = Lang,
|
||||||
{error, xmpp:err_bad_request(Txt, Lang)}
|
{error, xmpp:err_bad_request(Txt, Lang)}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_lists_get(binary(), binary(), binary(), undefined | binary()) ->
|
-spec process_lists_get(binary(), binary(), binary(), binary()) ->
|
||||||
{error, error()} | {result, privacy_query()}.
|
{error, error()} | {result, privacy_query()}.
|
||||||
process_lists_get(LUser, LServer, Active, Lang) ->
|
process_lists_get(LUser, LServer, Active, Lang) ->
|
||||||
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
||||||
|
@ -134,7 +134,7 @@ process_lists_get(LUser, LServer, Active, Lang) ->
|
||||||
|| ListName <- ListNames]}}
|
|| ListName <- ListNames]}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_list_get(binary(), binary(), binary(), undefined | binary()) ->
|
-spec process_list_get(binary(), binary(), binary(), binary()) ->
|
||||||
{error, error()} | {result, privacy_query()}.
|
{error, error()} | {result, privacy_query()}.
|
||||||
process_list_get(LUser, LServer, Name, Lang) ->
|
process_list_get(LUser, LServer, Name, Lang) ->
|
||||||
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
||||||
|
@ -183,7 +183,7 @@ encode_list_item(#listitem{action = Action,
|
||||||
presence_out = MatchPresenceOut}
|
presence_out = MatchPresenceOut}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec encode_value(listitem_type(), listitem_value()) -> undefined | binary().
|
-spec encode_value(listitem_type(), listitem_value()) -> binary().
|
||||||
encode_value(Type, Val) ->
|
encode_value(Type, Val) ->
|
||||||
case Type of
|
case Type of
|
||||||
jid -> jid:to_string(Val);
|
jid -> jid:to_string(Val);
|
||||||
|
@ -195,7 +195,7 @@ encode_value(Type, Val) ->
|
||||||
from -> <<"from">>;
|
from -> <<"from">>;
|
||||||
none -> <<"none">>
|
none -> <<"none">>
|
||||||
end;
|
end;
|
||||||
none -> undefined
|
none -> <<"">>
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec decode_value(jid | subscription | group | undefined, binary()) ->
|
-spec decode_value(jid | subscription | group | undefined, binary()) ->
|
||||||
|
@ -239,8 +239,7 @@ process_iq_set(_, #iq{from = From, lang = Lang,
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_default_set(binary(), binary(), none | binary(),
|
-spec process_default_set(binary(), binary(), none | binary(),
|
||||||
undefined | binary()) -> {error, error()} |
|
binary()) -> {error, error()} | {result, undefined}.
|
||||||
{result, undefined}.
|
|
||||||
process_default_set(LUser, LServer, Value, Lang) ->
|
process_default_set(LUser, LServer, Value, Lang) ->
|
||||||
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
||||||
case Mod:process_default_set(LUser, LServer, Value) of
|
case Mod:process_default_set(LUser, LServer, Value) of
|
||||||
|
@ -258,8 +257,7 @@ process_default_set(LUser, LServer, Value, Lang) ->
|
||||||
{error, xmpp:err_internal_server_error()}
|
{error, xmpp:err_internal_server_error()}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec process_active_set(binary(), binary(), none | binary(),
|
-spec process_active_set(binary(), binary(), none | binary(), binary()) ->
|
||||||
undefined | binary()) ->
|
|
||||||
{error, error()} |
|
{error, error()} |
|
||||||
{result, undefined, userlist()}.
|
{result, undefined, userlist()}.
|
||||||
process_active_set(_LUser, _LServer, none, _Lang) ->
|
process_active_set(_LUser, _LServer, none, _Lang) ->
|
||||||
|
@ -282,8 +280,7 @@ set_privacy_list(#privacy{us = {_, LServer}} = Privacy) ->
|
||||||
Mod:set_privacy_list(Privacy).
|
Mod:set_privacy_list(Privacy).
|
||||||
|
|
||||||
-spec process_lists_set(binary(), binary(), binary(), [privacy_item()],
|
-spec process_lists_set(binary(), binary(), binary(), [privacy_item()],
|
||||||
undefined | binary()) -> {error, error()} |
|
binary()) -> {error, error()} | {result, undefined}.
|
||||||
{result, undefined}.
|
|
||||||
process_lists_set(LUser, LServer, Name, [], Lang) ->
|
process_lists_set(LUser, LServer, Name, [], Lang) ->
|
||||||
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
||||||
case Mod:remove_privacy_list(LUser, LServer, Name) of
|
case Mod:remove_privacy_list(LUser, LServer, Name) of
|
||||||
|
|
|
@ -156,11 +156,6 @@ process_bytestreams(#iq{type = get, from = JID, to = To, lang = Lang} = IQ) ->
|
||||||
deny ->
|
deny ->
|
||||||
xmpp:make_error(IQ, xmpp:err_forbidden(<<"Denied by ACL">>, Lang))
|
xmpp:make_error(IQ, xmpp:err_forbidden(<<"Denied by ACL">>, Lang))
|
||||||
end;
|
end;
|
||||||
process_bytestreams(#iq{type = set, lang = Lang,
|
|
||||||
sub_els = [#bytestreams{sid = undefined}]} = IQ) ->
|
|
||||||
Why = {missing_attr, <<"sid">>, <<"query">>, ?NS_BYTESTREAMS},
|
|
||||||
Txt = xmpp:format_error(Why),
|
|
||||||
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang));
|
|
||||||
process_bytestreams(#iq{type = set, lang = Lang,
|
process_bytestreams(#iq{type = set, lang = Lang,
|
||||||
sub_els = [#bytestreams{sid = SID}]} = IQ)
|
sub_els = [#bytestreams{sid = SID}]} = IQ)
|
||||||
when SID == <<"">> orelse length(SID) > 128 ->
|
when SID == <<"">> orelse length(SID) > 128 ->
|
||||||
|
|
|
@ -151,15 +151,14 @@ do_route(_, _, _) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
-spec get_sm_features({error, error()} | empty | {result, [binary()]},
|
-spec get_sm_features({error, error()} | empty | {result, [binary()]},
|
||||||
jid(), jid(),
|
jid(), jid(), binary(), binary()) ->
|
||||||
undefined | binary(), undefined | binary()) ->
|
|
||||||
{error, error()} | empty | {result, [binary()]}.
|
{error, error()} | empty | {result, [binary()]}.
|
||||||
get_sm_features({error, _Error} = Acc, _From, _To,
|
get_sm_features({error, _Error} = Acc, _From, _To,
|
||||||
_Node, _Lang) ->
|
_Node, _Lang) ->
|
||||||
Acc;
|
Acc;
|
||||||
get_sm_features(Acc, _From, _To, Node, _Lang) ->
|
get_sm_features(Acc, _From, _To, Node, _Lang) ->
|
||||||
case Node of
|
case Node of
|
||||||
undefined ->
|
<<"">> ->
|
||||||
case Acc of
|
case Acc of
|
||||||
{result, Features} ->
|
{result, Features} ->
|
||||||
{result, [?NS_DISCO_INFO, ?NS_VCARD | Features]};
|
{result, [?NS_DISCO_INFO, ?NS_VCARD | Features]};
|
||||||
|
@ -232,10 +231,9 @@ process_search(#iq{type = set, lang = Lang} = IQ) ->
|
||||||
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang)).
|
xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang)).
|
||||||
|
|
||||||
-spec disco_items({error, error()} | {result, [disco_item()]} | empty,
|
-spec disco_items({error, error()} | {result, [disco_item()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(), binary(), binary()) ->
|
||||||
undefined | binary(), undefined | binary()) ->
|
|
||||||
{error, error()} | {result, [disco_item()]}.
|
{error, error()} | {result, [disco_item()]}.
|
||||||
disco_items(empty, _From, _To, undefined, _Lang) ->
|
disco_items(empty, _From, _To, <<"">>, _Lang) ->
|
||||||
{result, []};
|
{result, []};
|
||||||
disco_items(empty, _From, _To, _Node, Lang) ->
|
disco_items(empty, _From, _To, _Node, Lang) ->
|
||||||
{error, xmpp:err_item_not_found(<<"No services available">>, Lang)};
|
{error, xmpp:err_item_not_found(<<"No services available">>, Lang)};
|
||||||
|
@ -243,12 +241,11 @@ disco_items(Acc, _From, _To, _Node, _Lang) ->
|
||||||
Acc.
|
Acc.
|
||||||
|
|
||||||
-spec disco_features({error, error()} | {result, [binary()]} | empty,
|
-spec disco_features({error, error()} | {result, [binary()]} | empty,
|
||||||
jid(), jid(),
|
jid(), jid(), binary(), binary()) ->
|
||||||
undefined | binary(), undefined | binary()) ->
|
|
||||||
{error, error()} | {result, [binary()]}.
|
{error, error()} | {result, [binary()]}.
|
||||||
disco_features({error, _Error} = Acc, _From, _To, _Node, _Lang) ->
|
disco_features({error, _Error} = Acc, _From, _To, _Node, _Lang) ->
|
||||||
Acc;
|
Acc;
|
||||||
disco_features(Acc, _From, _To, undefined, _Lang) ->
|
disco_features(Acc, _From, _To, <<"">>, _Lang) ->
|
||||||
Features = case Acc of
|
Features = case Acc of
|
||||||
{result, Fs} -> Fs;
|
{result, Fs} -> Fs;
|
||||||
empty -> []
|
empty -> []
|
||||||
|
@ -261,9 +258,9 @@ disco_features(empty, _From, _To, _Node, Lang) ->
|
||||||
disco_features(Acc, _From, _To, _Node, _Lang) ->
|
disco_features(Acc, _From, _To, _Node, _Lang) ->
|
||||||
Acc.
|
Acc.
|
||||||
|
|
||||||
-spec disco_identity([identity()], jid(), jid(), undefined | binary(),
|
-spec disco_identity([identity()], jid(), jid(),
|
||||||
undefined | binary()) -> [identity()].
|
binary(), binary()) -> [identity()].
|
||||||
disco_identity(Acc, _From, _To, undefined, Lang) ->
|
disco_identity(Acc, _From, _To, <<"">>, Lang) ->
|
||||||
[#identity{category = <<"directory">>,
|
[#identity{category = <<"directory">>,
|
||||||
type = <<"user">>,
|
type = <<"user">>,
|
||||||
name = translate:translate(Lang, <<"vCard User Search">>)}|Acc];
|
name = translate:translate(Lang, <<"vCard User Search">>)}|Acc];
|
||||||
|
@ -362,7 +359,7 @@ string2lower(String) ->
|
||||||
error -> str:to_lower(String)
|
error -> str:to_lower(String)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec mk_tfield(binary(), binary(), undefined | binary()) -> xdata_field().
|
-spec mk_tfield(binary(), binary(), binary()) -> xdata_field().
|
||||||
mk_tfield(Label, Var, Lang) ->
|
mk_tfield(Label, Var, Lang) ->
|
||||||
#xdata_field{type = 'text-single',
|
#xdata_field{type = 'text-single',
|
||||||
label = translate:translate(Lang, Label),
|
label = translate:translate(Lang, Label),
|
||||||
|
@ -372,7 +369,7 @@ mk_tfield(Label, Var, Lang) ->
|
||||||
mk_field(Var, Val) ->
|
mk_field(Var, Val) ->
|
||||||
#xdata_field{var = Var, values = [Val]}.
|
#xdata_field{var = Var, values = [Val]}.
|
||||||
|
|
||||||
-spec mk_search_form(jid(), binary(), undefined | binary()) -> search().
|
-spec mk_search_form(jid(), binary(), binary()) -> search().
|
||||||
mk_search_form(JID, ServerHost, Lang) ->
|
mk_search_form(JID, ServerHost, Lang) ->
|
||||||
Title = <<(translate:translate(Lang, <<"Search users in ">>))/binary,
|
Title = <<(translate:translate(Lang, <<"Search users in ">>))/binary,
|
||||||
(jid:to_string(JID))/binary>>,
|
(jid:to_string(JID))/binary>>,
|
||||||
|
@ -393,7 +390,7 @@ mk_search_form(JID, ServerHost, Lang) ->
|
||||||
Lang, <<"You need an x:data capable client to search">>),
|
Lang, <<"You need an x:data capable client to search">>),
|
||||||
xdata = X}.
|
xdata = X}.
|
||||||
|
|
||||||
-spec search_result(undefined | binary(), jid(), binary(), [xdata_field()]) -> xdata().
|
-spec search_result(binary(), jid(), binary(), [xdata_field()]) -> xdata().
|
||||||
search_result(Lang, JID, ServerHost, XFields) ->
|
search_result(Lang, JID, ServerHost, XFields) ->
|
||||||
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
|
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
|
||||||
Reported = [mk_tfield(Label, Var, Lang) ||
|
Reported = [mk_tfield(Label, Var, Lang) ||
|
||||||
|
|
|
@ -126,10 +126,8 @@ load_file_loop(Fd, Line, File, Lang) ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec translate(binary() | undefined, binary()) -> binary().
|
-spec translate(binary(), binary()) -> binary().
|
||||||
|
|
||||||
translate(undefined, Msg) ->
|
|
||||||
translate(?MYLANG, Msg);
|
|
||||||
translate(Lang, Msg) ->
|
translate(Lang, Msg) ->
|
||||||
LLang = ascii_tolower(Lang),
|
LLang = ascii_tolower(Lang),
|
||||||
case ets:lookup(translations, {LLang, Msg}) of
|
case ets:lookup(translations, {LLang, Msg}) of
|
||||||
|
|
121
src/xmpp.erl
121
src/xmpp.erl
|
@ -119,15 +119,11 @@ make_error(#xmlel{attrs = Attrs, children = Els} = El, Err) ->
|
||||||
Attrs3 = lists:keystore(<<"type">>, 1, Attrs2, {<<"type">>, <<"error">>}),
|
Attrs3 = lists:keystore(<<"type">>, 1, Attrs2, {<<"type">>, <<"error">>}),
|
||||||
El#xmlel{attrs = Attrs3, children = Els ++ [encode(Err)]}.
|
El#xmlel{attrs = Attrs3, children = Els ++ [encode(Err)]}.
|
||||||
|
|
||||||
-spec get_id(iq() | message() | presence() | xmlel()) -> undefined | binary().
|
-spec get_id(iq() | message() | presence() | xmlel()) -> binary().
|
||||||
get_id(#iq{id = ID}) -> ID;
|
get_id(#iq{id = ID}) -> ID;
|
||||||
get_id(#message{id = ID}) -> ID;
|
get_id(#message{id = ID}) -> ID;
|
||||||
get_id(#presence{id = ID}) -> ID;
|
get_id(#presence{id = ID}) -> ID;
|
||||||
get_id(#xmlel{attrs = Attrs}) ->
|
get_id(#xmlel{attrs = Attrs}) -> fxml:get_attr_s(<<"id">>, Attrs).
|
||||||
case fxml:get_attr(<<"id">>, Attrs) of
|
|
||||||
{value, ID} -> ID;
|
|
||||||
false -> undefined
|
|
||||||
end.
|
|
||||||
|
|
||||||
-spec get_type(iq()) -> iq_type();
|
-spec get_type(iq()) -> iq_type();
|
||||||
(message()) -> message_type();
|
(message()) -> message_type();
|
||||||
|
@ -138,15 +134,11 @@ get_type(#message{type = T}) -> T;
|
||||||
get_type(#presence{type = T}) -> T;
|
get_type(#presence{type = T}) -> T;
|
||||||
get_type(#xmlel{attrs = Attrs}) -> fxml:get_attr_s(<<"type">>, Attrs).
|
get_type(#xmlel{attrs = Attrs}) -> fxml:get_attr_s(<<"type">>, Attrs).
|
||||||
|
|
||||||
-spec get_lang(iq() | message() | presence()) -> undefined | binary().
|
-spec get_lang(iq() | message() | presence()) -> binary().
|
||||||
get_lang(#iq{lang = L}) -> L;
|
get_lang(#iq{lang = L}) -> L;
|
||||||
get_lang(#message{lang = L}) -> L;
|
get_lang(#message{lang = L}) -> L;
|
||||||
get_lang(#presence{lang = L}) -> L;
|
get_lang(#presence{lang = L}) -> L;
|
||||||
get_lang(#xmlel{attrs = Attrs}) ->
|
get_lang(#xmlel{attrs = Attrs}) -> fxml:get_attr_s(<<"xml:lang">>, Attrs).
|
||||||
case fxml:get_attr(<<"xml:lang">>, Attrs) of
|
|
||||||
{value, L} -> L;
|
|
||||||
false -> undefined
|
|
||||||
end.
|
|
||||||
|
|
||||||
-spec get_from(iq() | message() | presence()) -> undefined | jid:jid().
|
-spec get_from(iq() | message() | presence()) -> undefined | jid:jid().
|
||||||
get_from(#iq{from = J}) -> J;
|
get_from(#iq{from = J}) -> J;
|
||||||
|
@ -371,14 +363,13 @@ has_subtag([], _, _) ->
|
||||||
|
|
||||||
-spec get_text([text()]) -> binary().
|
-spec get_text([text()]) -> binary().
|
||||||
get_text([]) -> <<"">>;
|
get_text([]) -> <<"">>;
|
||||||
get_text([#text{data = undefined}|_]) -> <<"">>;
|
|
||||||
get_text([#text{data = Data}|_]) -> Data.
|
get_text([#text{data = Data}|_]) -> Data.
|
||||||
|
|
||||||
-spec mk_text(binary()) -> [text()].
|
-spec mk_text(binary()) -> [text()].
|
||||||
mk_text(Text) ->
|
mk_text(Text) ->
|
||||||
mk_text(Text, undefined).
|
mk_text(Text, <<"">>).
|
||||||
|
|
||||||
-spec mk_text(binary(), binary() | undefined) -> [text()].
|
-spec mk_text(binary(), binary()) -> [text()].
|
||||||
mk_text(<<"">>, _) ->
|
mk_text(<<"">>, _) ->
|
||||||
[];
|
[];
|
||||||
mk_text(Text, Lang) ->
|
mk_text(Text, Lang) ->
|
||||||
|
@ -396,7 +387,7 @@ pp(Term) ->
|
||||||
err_bad_request() ->
|
err_bad_request() ->
|
||||||
err(modify, 'bad-request', 400).
|
err(modify, 'bad-request', 400).
|
||||||
|
|
||||||
-spec err_bad_request(binary(), binary() | undefined) -> error().
|
-spec err_bad_request(binary(), binary()) -> error().
|
||||||
err_bad_request(Text, Lang) ->
|
err_bad_request(Text, Lang) ->
|
||||||
err(modify, 'bad-request', 400, Text, Lang).
|
err(modify, 'bad-request', 400, Text, Lang).
|
||||||
|
|
||||||
|
@ -404,7 +395,7 @@ err_bad_request(Text, Lang) ->
|
||||||
err_conflict() ->
|
err_conflict() ->
|
||||||
err(cancel, 'conflict', 409).
|
err(cancel, 'conflict', 409).
|
||||||
|
|
||||||
-spec err_conflict(binary(), binary() | undefined) -> error().
|
-spec err_conflict(binary(), binary()) -> error().
|
||||||
err_conflict(Text, Lang) ->
|
err_conflict(Text, Lang) ->
|
||||||
err(cancel, 'conflict', 409, Text, Lang).
|
err(cancel, 'conflict', 409, Text, Lang).
|
||||||
|
|
||||||
|
@ -412,7 +403,7 @@ err_conflict(Text, Lang) ->
|
||||||
err_feature_not_implemented() ->
|
err_feature_not_implemented() ->
|
||||||
err(cancel, 'feature-not-implemented', 501).
|
err(cancel, 'feature-not-implemented', 501).
|
||||||
|
|
||||||
-spec err_feature_not_implemented(binary(), binary() | undefined) -> error().
|
-spec err_feature_not_implemented(binary(), binary()) -> error().
|
||||||
err_feature_not_implemented(Text, Lang) ->
|
err_feature_not_implemented(Text, Lang) ->
|
||||||
err(cancel, 'feature-not-implemented', 501, Text, Lang).
|
err(cancel, 'feature-not-implemented', 501, Text, Lang).
|
||||||
|
|
||||||
|
@ -420,7 +411,7 @@ err_feature_not_implemented(Text, Lang) ->
|
||||||
err_forbidden() ->
|
err_forbidden() ->
|
||||||
err(auth, 'forbidden', 403).
|
err(auth, 'forbidden', 403).
|
||||||
|
|
||||||
-spec err_forbidden(binary(), binary() | undefined) -> error().
|
-spec err_forbidden(binary(), binary()) -> error().
|
||||||
err_forbidden(Text, Lang) ->
|
err_forbidden(Text, Lang) ->
|
||||||
err(auth, 'forbidden', 403, Text, Lang).
|
err(auth, 'forbidden', 403, Text, Lang).
|
||||||
|
|
||||||
|
@ -430,7 +421,7 @@ err_forbidden(Text, Lang) ->
|
||||||
err_gone() ->
|
err_gone() ->
|
||||||
err(modify, 'gone', 302).
|
err(modify, 'gone', 302).
|
||||||
|
|
||||||
-spec err_gone(binary(), binary() | undefined) -> error().
|
-spec err_gone(binary(), binary()) -> error().
|
||||||
err_gone(Text, Lang) ->
|
err_gone(Text, Lang) ->
|
||||||
err(modify, 'gone', 302, Text, Lang).
|
err(modify, 'gone', 302, Text, Lang).
|
||||||
|
|
||||||
|
@ -440,7 +431,7 @@ err_gone(Text, Lang) ->
|
||||||
err_internal_server_error() ->
|
err_internal_server_error() ->
|
||||||
err(wait, 'internal-server-error', 500).
|
err(wait, 'internal-server-error', 500).
|
||||||
|
|
||||||
-spec err_internal_server_error(binary(), binary() | undefined) -> error().
|
-spec err_internal_server_error(binary(), binary()) -> error().
|
||||||
err_internal_server_error(Text, Lang) ->
|
err_internal_server_error(Text, Lang) ->
|
||||||
err(wait, 'internal-server-error', 500, Text, Lang).
|
err(wait, 'internal-server-error', 500, Text, Lang).
|
||||||
|
|
||||||
|
@ -448,7 +439,7 @@ err_internal_server_error(Text, Lang) ->
|
||||||
err_item_not_found() ->
|
err_item_not_found() ->
|
||||||
err(cancel, 'item-not-found', 404).
|
err(cancel, 'item-not-found', 404).
|
||||||
|
|
||||||
-spec err_item_not_found(binary(), binary() | undefined) -> error().
|
-spec err_item_not_found(binary(), binary()) -> error().
|
||||||
err_item_not_found(Text, Lang) ->
|
err_item_not_found(Text, Lang) ->
|
||||||
err(cancel, 'item-not-found', 404, Text, Lang).
|
err(cancel, 'item-not-found', 404, Text, Lang).
|
||||||
|
|
||||||
|
@ -456,7 +447,7 @@ err_item_not_found(Text, Lang) ->
|
||||||
err_jid_malformed() ->
|
err_jid_malformed() ->
|
||||||
err(modify, 'jid-malformed', 400).
|
err(modify, 'jid-malformed', 400).
|
||||||
|
|
||||||
-spec err_jid_malformed(binary(), binary() | undefined) -> error().
|
-spec err_jid_malformed(binary(), binary()) -> error().
|
||||||
err_jid_malformed(Text, Lang) ->
|
err_jid_malformed(Text, Lang) ->
|
||||||
err(modify, 'jid-malformed', 400, Text, Lang).
|
err(modify, 'jid-malformed', 400, Text, Lang).
|
||||||
|
|
||||||
|
@ -464,7 +455,7 @@ err_jid_malformed(Text, Lang) ->
|
||||||
err_not_acceptable() ->
|
err_not_acceptable() ->
|
||||||
err(modify, 'not-acceptable', 406).
|
err(modify, 'not-acceptable', 406).
|
||||||
|
|
||||||
-spec err_not_acceptable(binary(), binary() | undefined) -> error().
|
-spec err_not_acceptable(binary(), binary()) -> error().
|
||||||
err_not_acceptable(Text, Lang) ->
|
err_not_acceptable(Text, Lang) ->
|
||||||
err(modify, 'not-acceptable', 406, Text, Lang).
|
err(modify, 'not-acceptable', 406, Text, Lang).
|
||||||
|
|
||||||
|
@ -472,7 +463,7 @@ err_not_acceptable(Text, Lang) ->
|
||||||
err_not_allowed() ->
|
err_not_allowed() ->
|
||||||
err(cancel, 'not-allowed', 405).
|
err(cancel, 'not-allowed', 405).
|
||||||
|
|
||||||
-spec err_not_allowed(binary(), binary() | undefined) -> error().
|
-spec err_not_allowed(binary(), binary()) -> error().
|
||||||
err_not_allowed(Text, Lang) ->
|
err_not_allowed(Text, Lang) ->
|
||||||
err(cancel, 'not-allowed', 405, Text, Lang).
|
err(cancel, 'not-allowed', 405, Text, Lang).
|
||||||
|
|
||||||
|
@ -480,7 +471,7 @@ err_not_allowed(Text, Lang) ->
|
||||||
err_not_authorized() ->
|
err_not_authorized() ->
|
||||||
err(auth, 'not-authorized', 401).
|
err(auth, 'not-authorized', 401).
|
||||||
|
|
||||||
-spec err_not_authorized(binary(), binary() | undefined) -> error().
|
-spec err_not_authorized(binary(), binary()) -> error().
|
||||||
err_not_authorized(Text, Lang) ->
|
err_not_authorized(Text, Lang) ->
|
||||||
err(auth, 'not-authorized', 401, Text, Lang).
|
err(auth, 'not-authorized', 401, Text, Lang).
|
||||||
|
|
||||||
|
@ -488,7 +479,7 @@ err_not_authorized(Text, Lang) ->
|
||||||
err_payment_required() ->
|
err_payment_required() ->
|
||||||
err(auth, 'not-authorized', 402).
|
err(auth, 'not-authorized', 402).
|
||||||
|
|
||||||
-spec err_payment_required(binary(), binary() | undefined) -> error().
|
-spec err_payment_required(binary(), binary()) -> error().
|
||||||
err_payment_required(Text, Lang) ->
|
err_payment_required(Text, Lang) ->
|
||||||
err(auth, 'not-authorized', 402, Text, Lang).
|
err(auth, 'not-authorized', 402, Text, Lang).
|
||||||
|
|
||||||
|
@ -498,7 +489,7 @@ err_payment_required(Text, Lang) ->
|
||||||
err_policy_violation() ->
|
err_policy_violation() ->
|
||||||
err(modify, 'policy-violation', 403).
|
err(modify, 'policy-violation', 403).
|
||||||
|
|
||||||
-spec err_policy_violation(binary(), binary() | undefined) -> error().
|
-spec err_policy_violation(binary(), binary()) -> error().
|
||||||
err_policy_violation(Text, Lang) ->
|
err_policy_violation(Text, Lang) ->
|
||||||
err(modify, 'policy-violation', 403, Text, Lang).
|
err(modify, 'policy-violation', 403, Text, Lang).
|
||||||
|
|
||||||
|
@ -506,7 +497,7 @@ err_policy_violation(Text, Lang) ->
|
||||||
err_recipient_unavailable() ->
|
err_recipient_unavailable() ->
|
||||||
err(wait, 'recipient-unavailable', 404).
|
err(wait, 'recipient-unavailable', 404).
|
||||||
|
|
||||||
-spec err_recipient_unavailable(binary(), binary() | undefined) -> error().
|
-spec err_recipient_unavailable(binary(), binary()) -> error().
|
||||||
err_recipient_unavailable(Text, Lang) ->
|
err_recipient_unavailable(Text, Lang) ->
|
||||||
err(wait, 'recipient-unavailable', 404, Text, Lang).
|
err(wait, 'recipient-unavailable', 404, Text, Lang).
|
||||||
|
|
||||||
|
@ -514,7 +505,7 @@ err_recipient_unavailable(Text, Lang) ->
|
||||||
err_redirect() ->
|
err_redirect() ->
|
||||||
err(modify, 'redirect', 302).
|
err(modify, 'redirect', 302).
|
||||||
|
|
||||||
-spec err_redirect(binary(), binary() | undefined) -> error().
|
-spec err_redirect(binary(), binary()) -> error().
|
||||||
err_redirect(Text, Lang) ->
|
err_redirect(Text, Lang) ->
|
||||||
err(modify, 'redirect', 302, Text, Lang).
|
err(modify, 'redirect', 302, Text, Lang).
|
||||||
|
|
||||||
|
@ -522,7 +513,7 @@ err_redirect(Text, Lang) ->
|
||||||
err_registration_required() ->
|
err_registration_required() ->
|
||||||
err(auth, 'registration-required', 407).
|
err(auth, 'registration-required', 407).
|
||||||
|
|
||||||
-spec err_registration_required(binary(), binary() | undefined) -> error().
|
-spec err_registration_required(binary(), binary()) -> error().
|
||||||
err_registration_required(Text, Lang) ->
|
err_registration_required(Text, Lang) ->
|
||||||
err(auth, 'registration-required', 407, Text, Lang).
|
err(auth, 'registration-required', 407, Text, Lang).
|
||||||
|
|
||||||
|
@ -530,7 +521,7 @@ err_registration_required(Text, Lang) ->
|
||||||
err_remote_server_not_found() ->
|
err_remote_server_not_found() ->
|
||||||
err(cancel, 'remote-server-not-found', 404).
|
err(cancel, 'remote-server-not-found', 404).
|
||||||
|
|
||||||
-spec err_remote_server_not_found(binary(), binary() | undefined) -> error().
|
-spec err_remote_server_not_found(binary(), binary()) -> error().
|
||||||
err_remote_server_not_found(Text, Lang) ->
|
err_remote_server_not_found(Text, Lang) ->
|
||||||
err(cancel, 'remote-server-not-found', 404, Text, Lang).
|
err(cancel, 'remote-server-not-found', 404, Text, Lang).
|
||||||
|
|
||||||
|
@ -538,7 +529,7 @@ err_remote_server_not_found(Text, Lang) ->
|
||||||
err_remote_server_timeout() ->
|
err_remote_server_timeout() ->
|
||||||
err(wait, 'remote-server-timeout', 504).
|
err(wait, 'remote-server-timeout', 504).
|
||||||
|
|
||||||
-spec err_remote_server_timeout(binary(), binary() | undefined) -> error().
|
-spec err_remote_server_timeout(binary(), binary()) -> error().
|
||||||
err_remote_server_timeout(Text, Lang) ->
|
err_remote_server_timeout(Text, Lang) ->
|
||||||
err(wait, 'remote-server-timeout', 504, Text, Lang).
|
err(wait, 'remote-server-timeout', 504, Text, Lang).
|
||||||
|
|
||||||
|
@ -546,7 +537,7 @@ err_remote_server_timeout(Text, Lang) ->
|
||||||
err_resource_constraint() ->
|
err_resource_constraint() ->
|
||||||
err(wait, 'resource-constraint', 500).
|
err(wait, 'resource-constraint', 500).
|
||||||
|
|
||||||
-spec err_resource_constraint(binary(), binary() | undefined) -> error().
|
-spec err_resource_constraint(binary(), binary()) -> error().
|
||||||
err_resource_constraint(Text, Lang) ->
|
err_resource_constraint(Text, Lang) ->
|
||||||
err(wait, 'resource-constraint', 500, Text, Lang).
|
err(wait, 'resource-constraint', 500, Text, Lang).
|
||||||
|
|
||||||
|
@ -554,7 +545,7 @@ err_resource_constraint(Text, Lang) ->
|
||||||
err_service_unavailable() ->
|
err_service_unavailable() ->
|
||||||
err(cancel, 'service-unavailable', 503).
|
err(cancel, 'service-unavailable', 503).
|
||||||
|
|
||||||
-spec err_service_unavailable(binary(), binary() | undefined) -> error().
|
-spec err_service_unavailable(binary(), binary()) -> error().
|
||||||
err_service_unavailable(Text, Lang) ->
|
err_service_unavailable(Text, Lang) ->
|
||||||
err(cancel, 'service-unavailable', 503, Text, Lang).
|
err(cancel, 'service-unavailable', 503, Text, Lang).
|
||||||
|
|
||||||
|
@ -562,7 +553,7 @@ err_service_unavailable(Text, Lang) ->
|
||||||
err_subscription_required() ->
|
err_subscription_required() ->
|
||||||
err(auth, 'subscription-required', 407).
|
err(auth, 'subscription-required', 407).
|
||||||
|
|
||||||
-spec err_subscription_required(binary(), binary() | undefined) -> error().
|
-spec err_subscription_required(binary(), binary()) -> error().
|
||||||
err_subscription_required(Text, Lang) ->
|
err_subscription_required(Text, Lang) ->
|
||||||
err(auth, 'subscription-required', 407, Text, Lang).
|
err(auth, 'subscription-required', 407, Text, Lang).
|
||||||
|
|
||||||
|
@ -574,7 +565,7 @@ err_undefined_condition(Type) ->
|
||||||
err(Type, 'undefined-condition', 500).
|
err(Type, 'undefined-condition', 500).
|
||||||
|
|
||||||
-spec err_undefined_condition('auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
-spec err_undefined_condition('auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
||||||
binary(), binary() | undefined) -> error().
|
binary(), binary()) -> error().
|
||||||
err_undefined_condition(Type, Text, Lang) ->
|
err_undefined_condition(Type, Text, Lang) ->
|
||||||
err(Type, 'undefined-condition', 500, Text, Lang).
|
err(Type, 'undefined-condition', 500, Text, Lang).
|
||||||
|
|
||||||
|
@ -584,7 +575,7 @@ err_undefined_condition(Type, Text, Lang) ->
|
||||||
err_unexpected_request() ->
|
err_unexpected_request() ->
|
||||||
err(wait, 'unexpected-request', 400).
|
err(wait, 'unexpected-request', 400).
|
||||||
|
|
||||||
-spec err_unexpected_request(binary(), binary() | undefined) -> error().
|
-spec err_unexpected_request(binary(), binary()) -> error().
|
||||||
err_unexpected_request(Text, Lang) ->
|
err_unexpected_request(Text, Lang) ->
|
||||||
err(wait, 'unexpected-request', 400, Text, Lang).
|
err(wait, 'unexpected-request', 400, Text, Lang).
|
||||||
|
|
||||||
|
@ -595,7 +586,7 @@ err_unexpected_request(Text, Lang) ->
|
||||||
serr_bad_format() ->
|
serr_bad_format() ->
|
||||||
serr('bad-format').
|
serr('bad-format').
|
||||||
|
|
||||||
-spec serr_bad_format(binary(), binary() | undefined) -> stream_error().
|
-spec serr_bad_format(binary(), binary()) -> stream_error().
|
||||||
serr_bad_format(Text, Lang) ->
|
serr_bad_format(Text, Lang) ->
|
||||||
serr('bad-format', Text, Lang).
|
serr('bad-format', Text, Lang).
|
||||||
|
|
||||||
|
@ -603,7 +594,7 @@ serr_bad_format(Text, Lang) ->
|
||||||
serr_bad_namespace_prefix() ->
|
serr_bad_namespace_prefix() ->
|
||||||
serr('bad-namespace-prefix').
|
serr('bad-namespace-prefix').
|
||||||
|
|
||||||
-spec serr_bad_namespace_prefix(binary(), binary() | undefined) -> stream_error().
|
-spec serr_bad_namespace_prefix(binary(), binary()) -> stream_error().
|
||||||
serr_bad_namespace_prefix(Text, Lang) ->
|
serr_bad_namespace_prefix(Text, Lang) ->
|
||||||
serr('bad-namespace-prefix', Text, Lang).
|
serr('bad-namespace-prefix', Text, Lang).
|
||||||
|
|
||||||
|
@ -611,7 +602,7 @@ serr_bad_namespace_prefix(Text, Lang) ->
|
||||||
serr_conflict() ->
|
serr_conflict() ->
|
||||||
serr('conflict').
|
serr('conflict').
|
||||||
|
|
||||||
-spec serr_conflict(binary(), binary() | undefined) -> stream_error().
|
-spec serr_conflict(binary(), binary()) -> stream_error().
|
||||||
serr_conflict(Text, Lang) ->
|
serr_conflict(Text, Lang) ->
|
||||||
serr('conflict', Text, Lang).
|
serr('conflict', Text, Lang).
|
||||||
|
|
||||||
|
@ -619,7 +610,7 @@ serr_conflict(Text, Lang) ->
|
||||||
serr_connection_timeout() ->
|
serr_connection_timeout() ->
|
||||||
serr('connection-timeout').
|
serr('connection-timeout').
|
||||||
|
|
||||||
-spec serr_connection_timeout(binary(), binary() | undefined) -> stream_error().
|
-spec serr_connection_timeout(binary(), binary()) -> stream_error().
|
||||||
serr_connection_timeout(Text, Lang) ->
|
serr_connection_timeout(Text, Lang) ->
|
||||||
serr('connection-timeout', Text, Lang).
|
serr('connection-timeout', Text, Lang).
|
||||||
|
|
||||||
|
@ -627,7 +618,7 @@ serr_connection_timeout(Text, Lang) ->
|
||||||
serr_host_gone() ->
|
serr_host_gone() ->
|
||||||
serr('host-gone').
|
serr('host-gone').
|
||||||
|
|
||||||
-spec serr_host_gone(binary(), binary() | undefined) -> stream_error().
|
-spec serr_host_gone(binary(), binary()) -> stream_error().
|
||||||
serr_host_gone(Text, Lang) ->
|
serr_host_gone(Text, Lang) ->
|
||||||
serr('host-gone', Text, Lang).
|
serr('host-gone', Text, Lang).
|
||||||
|
|
||||||
|
@ -635,7 +626,7 @@ serr_host_gone(Text, Lang) ->
|
||||||
serr_host_unknown() ->
|
serr_host_unknown() ->
|
||||||
serr('host-unknown').
|
serr('host-unknown').
|
||||||
|
|
||||||
-spec serr_host_unknown(binary(), binary() | undefined) -> stream_error().
|
-spec serr_host_unknown(binary(), binary()) -> stream_error().
|
||||||
serr_host_unknown(Text, Lang) ->
|
serr_host_unknown(Text, Lang) ->
|
||||||
serr('host-unknown', Text, Lang).
|
serr('host-unknown', Text, Lang).
|
||||||
|
|
||||||
|
@ -643,7 +634,7 @@ serr_host_unknown(Text, Lang) ->
|
||||||
serr_improper_addressing() ->
|
serr_improper_addressing() ->
|
||||||
serr('improper-addressing').
|
serr('improper-addressing').
|
||||||
|
|
||||||
-spec serr_improper_addressing(binary(), binary() | undefined) -> stream_error().
|
-spec serr_improper_addressing(binary(), binary()) -> stream_error().
|
||||||
serr_improper_addressing(Text, Lang) ->
|
serr_improper_addressing(Text, Lang) ->
|
||||||
serr('improper-addressing', Text, Lang).
|
serr('improper-addressing', Text, Lang).
|
||||||
|
|
||||||
|
@ -651,7 +642,7 @@ serr_improper_addressing(Text, Lang) ->
|
||||||
serr_internal_server_error() ->
|
serr_internal_server_error() ->
|
||||||
serr('internal-server-error').
|
serr('internal-server-error').
|
||||||
|
|
||||||
-spec serr_internal_server_error(binary(), binary() | undefined) -> stream_error().
|
-spec serr_internal_server_error(binary(), binary()) -> stream_error().
|
||||||
serr_internal_server_error(Text, Lang) ->
|
serr_internal_server_error(Text, Lang) ->
|
||||||
serr('internal-server-error', Text, Lang).
|
serr('internal-server-error', Text, Lang).
|
||||||
|
|
||||||
|
@ -659,7 +650,7 @@ serr_internal_server_error(Text, Lang) ->
|
||||||
serr_invalid_from() ->
|
serr_invalid_from() ->
|
||||||
serr('invalid-from').
|
serr('invalid-from').
|
||||||
|
|
||||||
-spec serr_invalid_from(binary(), binary() | undefined) -> stream_error().
|
-spec serr_invalid_from(binary(), binary()) -> stream_error().
|
||||||
serr_invalid_from(Text, Lang) ->
|
serr_invalid_from(Text, Lang) ->
|
||||||
serr('invalid-from', Text, Lang).
|
serr('invalid-from', Text, Lang).
|
||||||
|
|
||||||
|
@ -667,7 +658,7 @@ serr_invalid_from(Text, Lang) ->
|
||||||
serr_invalid_id() ->
|
serr_invalid_id() ->
|
||||||
serr('invalid-id').
|
serr('invalid-id').
|
||||||
|
|
||||||
-spec serr_invalid_id(binary(), binary() | undefined) -> stream_error().
|
-spec serr_invalid_id(binary(), binary()) -> stream_error().
|
||||||
serr_invalid_id(Text, Lang) ->
|
serr_invalid_id(Text, Lang) ->
|
||||||
serr('invalid-id', Text, Lang).
|
serr('invalid-id', Text, Lang).
|
||||||
|
|
||||||
|
@ -675,7 +666,7 @@ serr_invalid_id(Text, Lang) ->
|
||||||
serr_invalid_namespace() ->
|
serr_invalid_namespace() ->
|
||||||
serr('invalid-namespace').
|
serr('invalid-namespace').
|
||||||
|
|
||||||
-spec serr_invalid_namespace(binary(), binary() | undefined) -> stream_error().
|
-spec serr_invalid_namespace(binary(), binary()) -> stream_error().
|
||||||
serr_invalid_namespace(Text, Lang) ->
|
serr_invalid_namespace(Text, Lang) ->
|
||||||
serr('invalid-namespace', Text, Lang).
|
serr('invalid-namespace', Text, Lang).
|
||||||
|
|
||||||
|
@ -683,7 +674,7 @@ serr_invalid_namespace(Text, Lang) ->
|
||||||
serr_invalid_xml() ->
|
serr_invalid_xml() ->
|
||||||
serr('invalid-xml').
|
serr('invalid-xml').
|
||||||
|
|
||||||
-spec serr_invalid_xml(binary(), binary() | undefined) -> stream_error().
|
-spec serr_invalid_xml(binary(), binary()) -> stream_error().
|
||||||
serr_invalid_xml(Text, Lang) ->
|
serr_invalid_xml(Text, Lang) ->
|
||||||
serr('invalid-xml', Text, Lang).
|
serr('invalid-xml', Text, Lang).
|
||||||
|
|
||||||
|
@ -691,7 +682,7 @@ serr_invalid_xml(Text, Lang) ->
|
||||||
serr_not_authorized() ->
|
serr_not_authorized() ->
|
||||||
serr('not-authorized').
|
serr('not-authorized').
|
||||||
|
|
||||||
-spec serr_not_authorized(binary(), binary() | undefined) -> stream_error().
|
-spec serr_not_authorized(binary(), binary()) -> stream_error().
|
||||||
serr_not_authorized(Text, Lang) ->
|
serr_not_authorized(Text, Lang) ->
|
||||||
serr('not-authorized', Text, Lang).
|
serr('not-authorized', Text, Lang).
|
||||||
|
|
||||||
|
@ -699,7 +690,7 @@ serr_not_authorized(Text, Lang) ->
|
||||||
serr_not_well_formed() ->
|
serr_not_well_formed() ->
|
||||||
serr('not-well-formed').
|
serr('not-well-formed').
|
||||||
|
|
||||||
-spec serr_not_well_formed(binary(), binary() | undefined) -> stream_error().
|
-spec serr_not_well_formed(binary(), binary()) -> stream_error().
|
||||||
serr_not_well_formed(Text, Lang) ->
|
serr_not_well_formed(Text, Lang) ->
|
||||||
serr('not-well-formed', Text, Lang).
|
serr('not-well-formed', Text, Lang).
|
||||||
|
|
||||||
|
@ -707,7 +698,7 @@ serr_not_well_formed(Text, Lang) ->
|
||||||
serr_policy_violation() ->
|
serr_policy_violation() ->
|
||||||
serr('policy-violation').
|
serr('policy-violation').
|
||||||
|
|
||||||
-spec serr_policy_violation(binary(), binary() | undefined) -> stream_error().
|
-spec serr_policy_violation(binary(), binary()) -> stream_error().
|
||||||
serr_policy_violation(Text, Lang) ->
|
serr_policy_violation(Text, Lang) ->
|
||||||
serr('policy-violation', Text, Lang).
|
serr('policy-violation', Text, Lang).
|
||||||
|
|
||||||
|
@ -715,7 +706,7 @@ serr_policy_violation(Text, Lang) ->
|
||||||
serr_remote_connection_failed() ->
|
serr_remote_connection_failed() ->
|
||||||
serr('remote-connection-failed').
|
serr('remote-connection-failed').
|
||||||
|
|
||||||
-spec serr_remote_connection_failed(binary(), binary() | undefined) -> stream_error().
|
-spec serr_remote_connection_failed(binary(), binary()) -> stream_error().
|
||||||
serr_remote_connection_failed(Text, Lang) ->
|
serr_remote_connection_failed(Text, Lang) ->
|
||||||
serr('remote-connection-failed', Text, Lang).
|
serr('remote-connection-failed', Text, Lang).
|
||||||
|
|
||||||
|
@ -723,7 +714,7 @@ serr_remote_connection_failed(Text, Lang) ->
|
||||||
serr_reset() ->
|
serr_reset() ->
|
||||||
serr('reset').
|
serr('reset').
|
||||||
|
|
||||||
-spec serr_reset(binary(), binary() | undefined) -> stream_error().
|
-spec serr_reset(binary(), binary()) -> stream_error().
|
||||||
serr_reset(Text, Lang) ->
|
serr_reset(Text, Lang) ->
|
||||||
serr('reset', Text, Lang).
|
serr('reset', Text, Lang).
|
||||||
|
|
||||||
|
@ -731,7 +722,7 @@ serr_reset(Text, Lang) ->
|
||||||
serr_resource_constraint() ->
|
serr_resource_constraint() ->
|
||||||
serr('resource-constraint').
|
serr('resource-constraint').
|
||||||
|
|
||||||
-spec serr_resource_constraint(binary(), binary() | undefined) -> stream_error().
|
-spec serr_resource_constraint(binary(), binary()) -> stream_error().
|
||||||
serr_resource_constraint(Text, Lang) ->
|
serr_resource_constraint(Text, Lang) ->
|
||||||
serr('resource-constraint', Text, Lang).
|
serr('resource-constraint', Text, Lang).
|
||||||
|
|
||||||
|
@ -739,7 +730,7 @@ serr_resource_constraint(Text, Lang) ->
|
||||||
serr_restricted_xml() ->
|
serr_restricted_xml() ->
|
||||||
serr('restricted-xml').
|
serr('restricted-xml').
|
||||||
|
|
||||||
-spec serr_restricted_xml(binary(), binary() | undefined) -> stream_error().
|
-spec serr_restricted_xml(binary(), binary()) -> stream_error().
|
||||||
serr_restricted_xml(Text, Lang) ->
|
serr_restricted_xml(Text, Lang) ->
|
||||||
serr('restricted-xml', Text, Lang).
|
serr('restricted-xml', Text, Lang).
|
||||||
|
|
||||||
|
@ -747,7 +738,7 @@ serr_restricted_xml(Text, Lang) ->
|
||||||
serr_see_other_host() ->
|
serr_see_other_host() ->
|
||||||
serr('see-other-host').
|
serr('see-other-host').
|
||||||
|
|
||||||
-spec serr_see_other_host(binary(), binary() | undefined) -> stream_error().
|
-spec serr_see_other_host(binary(), binary()) -> stream_error().
|
||||||
serr_see_other_host(Text, Lang) ->
|
serr_see_other_host(Text, Lang) ->
|
||||||
serr('see-other-host', Text, Lang).
|
serr('see-other-host', Text, Lang).
|
||||||
|
|
||||||
|
@ -755,7 +746,7 @@ serr_see_other_host(Text, Lang) ->
|
||||||
serr_system_shutdown() ->
|
serr_system_shutdown() ->
|
||||||
serr('system-shutdown').
|
serr('system-shutdown').
|
||||||
|
|
||||||
-spec serr_system_shutdown(binary(), binary() | undefined) -> stream_error().
|
-spec serr_system_shutdown(binary(), binary()) -> stream_error().
|
||||||
serr_system_shutdown(Text, Lang) ->
|
serr_system_shutdown(Text, Lang) ->
|
||||||
serr('system-shutdown', Text, Lang).
|
serr('system-shutdown', Text, Lang).
|
||||||
|
|
||||||
|
@ -763,7 +754,7 @@ serr_system_shutdown(Text, Lang) ->
|
||||||
serr_undefined_condition() ->
|
serr_undefined_condition() ->
|
||||||
serr('undefined-condition').
|
serr('undefined-condition').
|
||||||
|
|
||||||
-spec serr_undefined_condition(binary(), binary() | undefined) -> stream_error().
|
-spec serr_undefined_condition(binary(), binary()) -> stream_error().
|
||||||
serr_undefined_condition(Text, Lang) ->
|
serr_undefined_condition(Text, Lang) ->
|
||||||
serr('undefined-condition', Text, Lang).
|
serr('undefined-condition', Text, Lang).
|
||||||
|
|
||||||
|
@ -771,7 +762,7 @@ serr_undefined_condition(Text, Lang) ->
|
||||||
serr_unsupported_encoding() ->
|
serr_unsupported_encoding() ->
|
||||||
serr('unsupported-encoding').
|
serr('unsupported-encoding').
|
||||||
|
|
||||||
-spec serr_unsupported_encoding(binary(), binary() | undefined) -> stream_error().
|
-spec serr_unsupported_encoding(binary(), binary()) -> stream_error().
|
||||||
serr_unsupported_encoding(Text, Lang) ->
|
serr_unsupported_encoding(Text, Lang) ->
|
||||||
serr('unsupported-encoding', Text, Lang).
|
serr('unsupported-encoding', Text, Lang).
|
||||||
|
|
||||||
|
@ -779,7 +770,7 @@ serr_unsupported_encoding(Text, Lang) ->
|
||||||
serr_unsupported_stanza_type() ->
|
serr_unsupported_stanza_type() ->
|
||||||
serr('unsupported-stanza-type').
|
serr('unsupported-stanza-type').
|
||||||
|
|
||||||
-spec serr_unsupported_stanza_type(binary(), binary() | undefined) -> stream_error().
|
-spec serr_unsupported_stanza_type(binary(), binary()) -> stream_error().
|
||||||
serr_unsupported_stanza_type(Text, Lang) ->
|
serr_unsupported_stanza_type(Text, Lang) ->
|
||||||
serr('unsupported-stanza-type', Text, Lang).
|
serr('unsupported-stanza-type', Text, Lang).
|
||||||
|
|
||||||
|
@ -787,7 +778,7 @@ serr_unsupported_stanza_type(Text, Lang) ->
|
||||||
serr_unsupported_version() ->
|
serr_unsupported_version() ->
|
||||||
serr('unsupported-version').
|
serr('unsupported-version').
|
||||||
|
|
||||||
-spec serr_unsupported_version(binary(), binary() | undefined) -> stream_error().
|
-spec serr_unsupported_version(binary(), binary()) -> stream_error().
|
||||||
serr_unsupported_version(Text, Lang) ->
|
serr_unsupported_version(Text, Lang) ->
|
||||||
serr('unsupported-version', Text, Lang).
|
serr('unsupported-version', Text, Lang).
|
||||||
|
|
||||||
|
@ -801,7 +792,7 @@ err(Type, Reason, Code) ->
|
||||||
|
|
||||||
-spec err('auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
-spec err('auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
||||||
atom() | gone() | redirect(), non_neg_integer(),
|
atom() | gone() | redirect(), non_neg_integer(),
|
||||||
binary(), binary() | undefined) -> error().
|
binary(), binary()) -> error().
|
||||||
err(Type, Reason, Code, Text, Lang) ->
|
err(Type, Reason, Code, Text, Lang) ->
|
||||||
#error{type = Type, reason = Reason, code = Code,
|
#error{type = Type, reason = Reason, code = Code,
|
||||||
text = #text{lang = Lang,
|
text = #text{lang = Lang,
|
||||||
|
@ -812,7 +803,7 @@ serr(Reason) ->
|
||||||
#stream_error{reason = Reason}.
|
#stream_error{reason = Reason}.
|
||||||
|
|
||||||
-spec serr(atom() | 'see-other-host'(), binary(),
|
-spec serr(atom() | 'see-other-host'(), binary(),
|
||||||
binary() | undefined) -> stream_error().
|
binary()) -> stream_error().
|
||||||
serr(Reason, Text, Lang) ->
|
serr(Reason, Text, Lang) ->
|
||||||
#stream_error{reason = Reason,
|
#stream_error{reason = Reason,
|
||||||
text = #text{lang = Lang,
|
text = #text{lang = Lang,
|
||||||
|
|
1110
src/xmpp_codec.erl
1110
src/xmpp_codec.erl
File diff suppressed because it is too large
Load Diff
|
@ -94,7 +94,7 @@ make_adhoc_response(#adhoc_command{lang = Lang, node = Node, sid = SID},
|
||||||
Command#adhoc_command{lang = Lang, node = Node, sid = SID}.
|
Command#adhoc_command{lang = Lang, node = Node, sid = SID}.
|
||||||
|
|
||||||
-spec make_adhoc_response(adhoc_command()) -> adhoc_command().
|
-spec make_adhoc_response(adhoc_command()) -> adhoc_command().
|
||||||
make_adhoc_response(#adhoc_command{sid = undefined} = Command) ->
|
make_adhoc_response(#adhoc_command{sid = <<"">>} = Command) ->
|
||||||
SID = jlib:now_to_utc_string(p1_time_compat:timestamp()),
|
SID = jlib:now_to_utc_string(p1_time_compat:timestamp()),
|
||||||
Command#adhoc_command{sid = SID};
|
Command#adhoc_command{sid = SID};
|
||||||
make_adhoc_response(Command) ->
|
make_adhoc_response(Command) ->
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
#elem{name = <<"query">>,
|
#elem{name = <<"query">>,
|
||||||
xmlns = <<"jabber:iq:roster">>,
|
xmlns = <<"jabber:iq:roster">>,
|
||||||
result = {roster_query, '$items', '$ver'},
|
result = {roster_query, '$items', '$ver'},
|
||||||
attrs = [#attr{name = <<"ver">>}],
|
attrs = [#attr{name = <<"ver">>, default = undefined}],
|
||||||
refs = [#ref{name = roster_item, label = '$items'}]}).
|
refs = [#ref{name = roster_item, label = '$items'}]}).
|
||||||
|
|
||||||
-xml(rosterver_feature,
|
-xml(rosterver_feature,
|
||||||
|
@ -616,22 +616,18 @@
|
||||||
-xml(legacy_auth_username,
|
-xml(legacy_auth_username,
|
||||||
#elem{name = <<"username">>,
|
#elem{name = <<"username">>,
|
||||||
xmlns = <<"jabber:iq:auth">>,
|
xmlns = <<"jabber:iq:auth">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(legacy_auth_password,
|
-xml(legacy_auth_password,
|
||||||
#elem{name = <<"password">>,
|
#elem{name = <<"password">>,
|
||||||
xmlns = <<"jabber:iq:auth">>,
|
xmlns = <<"jabber:iq:auth">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(legacy_auth_digest,
|
-xml(legacy_auth_digest,
|
||||||
#elem{name = <<"digest">>,
|
#elem{name = <<"digest">>,
|
||||||
xmlns = <<"jabber:iq:auth">>,
|
xmlns = <<"jabber:iq:auth">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(legacy_auth_resource,
|
-xml(legacy_auth_resource,
|
||||||
#elem{name = <<"resource">>,
|
#elem{name = <<"resource">>,
|
||||||
xmlns = <<"jabber:iq:auth">>,
|
xmlns = <<"jabber:iq:auth">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
|
|
||||||
-xml(legacy_auth,
|
-xml(legacy_auth,
|
||||||
|
@ -917,87 +913,70 @@
|
||||||
-xml(register_username,
|
-xml(register_username,
|
||||||
#elem{name = <<"username">>,
|
#elem{name = <<"username">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_nick,
|
-xml(register_nick,
|
||||||
#elem{name = <<"nick">>,
|
#elem{name = <<"nick">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_password,
|
-xml(register_password,
|
||||||
#elem{name = <<"password">>,
|
#elem{name = <<"password">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_name,
|
-xml(register_name,
|
||||||
#elem{name = <<"name">>,
|
#elem{name = <<"name">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_first,
|
-xml(register_first,
|
||||||
#elem{name = <<"first">>,
|
#elem{name = <<"first">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_last,
|
-xml(register_last,
|
||||||
#elem{name = <<"last">>,
|
#elem{name = <<"last">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_email,
|
-xml(register_email,
|
||||||
#elem{name = <<"email">>,
|
#elem{name = <<"email">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_address,
|
-xml(register_address,
|
||||||
#elem{name = <<"address">>,
|
#elem{name = <<"address">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_city,
|
-xml(register_city,
|
||||||
#elem{name = <<"city">>,
|
#elem{name = <<"city">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_state,
|
-xml(register_state,
|
||||||
#elem{name = <<"state">>,
|
#elem{name = <<"state">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_zip,
|
-xml(register_zip,
|
||||||
#elem{name = <<"zip">>,
|
#elem{name = <<"zip">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_phone,
|
-xml(register_phone,
|
||||||
#elem{name = <<"phone">>,
|
#elem{name = <<"phone">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_url,
|
-xml(register_url,
|
||||||
#elem{name = <<"url">>,
|
#elem{name = <<"url">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_date,
|
-xml(register_date,
|
||||||
#elem{name = <<"date">>,
|
#elem{name = <<"date">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_misc,
|
-xml(register_misc,
|
||||||
#elem{name = <<"misc">>,
|
#elem{name = <<"misc">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_text,
|
-xml(register_text,
|
||||||
#elem{name = <<"text">>,
|
#elem{name = <<"text">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
-xml(register_key,
|
-xml(register_key,
|
||||||
#elem{name = <<"key">>,
|
#elem{name = <<"key">>,
|
||||||
xmlns = <<"jabber:iq:register">>,
|
xmlns = <<"jabber:iq:register">>,
|
||||||
cdata = #cdata{default = none},
|
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
|
|
||||||
-xml(register,
|
-xml(register,
|
||||||
|
@ -1180,7 +1159,9 @@
|
||||||
xmlns = <<"urn:ietf:params:xml:ns:xmpp-streams">>}).
|
xmlns = <<"urn:ietf:params:xml:ns:xmpp-streams">>}).
|
||||||
-xml(stream_error_see_other_host,
|
-xml(stream_error_see_other_host,
|
||||||
#elem{name = <<"see-other-host">>,
|
#elem{name = <<"see-other-host">>,
|
||||||
cdata = #cdata{required = true, label = '$host'},
|
cdata = #cdata{required = true, label = '$host',
|
||||||
|
dec = {dec_host_port, []},
|
||||||
|
enc = {enc_host_port, []}},
|
||||||
result = {'see-other-host', '$host'},
|
result = {'see-other-host', '$host'},
|
||||||
xmlns = <<"urn:ietf:params:xml:ns:xmpp-streams">>}).
|
xmlns = <<"urn:ietf:params:xml:ns:xmpp-streams">>}).
|
||||||
-xml(stream_error_system_shutdown,
|
-xml(stream_error_system_shutdown,
|
||||||
|
@ -1562,14 +1543,14 @@
|
||||||
xmlns = <<"vcard-temp:x:update">>,
|
xmlns = <<"vcard-temp:x:update">>,
|
||||||
result = '$cdata'}).
|
result = '$cdata'}).
|
||||||
|
|
||||||
-record(vcard_xupdate, {us :: {binary(), binary()},
|
-record(vcard_xupdate, {us = {<<>>, <<>>} :: {binary(), binary()},
|
||||||
hash :: binary()}).
|
hash :: binary()}).
|
||||||
-type vcard_xupdate() :: #vcard_xupdate{}.
|
-type vcard_xupdate() :: #vcard_xupdate{}.
|
||||||
|
|
||||||
-xml(vcard_xupdate,
|
-xml(vcard_xupdate,
|
||||||
#elem{name = <<"x">>,
|
#elem{name = <<"x">>,
|
||||||
xmlns = <<"vcard-temp:x:update">>,
|
xmlns = <<"vcard-temp:x:update">>,
|
||||||
result = {vcard_xupdate, undefined, '$hash'},
|
result = {vcard_xupdate, '$_', '$hash'},
|
||||||
refs = [#ref{name = vcard_xupdate_photo, min = 0, max = 1,
|
refs = [#ref{name = vcard_xupdate_photo, min = 0, max = 1,
|
||||||
label = '$hash'}]}).
|
label = '$hash'}]}).
|
||||||
|
|
||||||
|
@ -1745,8 +1726,7 @@
|
||||||
#elem{name = <<"subscriptions">>,
|
#elem{name = <<"subscriptions">>,
|
||||||
xmlns = <<"http://jabber.org/protocol/pubsub">>,
|
xmlns = <<"http://jabber.org/protocol/pubsub">>,
|
||||||
result = {'$node', '$subscriptions'},
|
result = {'$node', '$subscriptions'},
|
||||||
attrs = [#attr{name = <<"node">>,
|
attrs = [#attr{name = <<"node">>}],
|
||||||
default = none}],
|
|
||||||
refs = [#ref{name = pubsub_subscription, label = '$subscriptions'}]}).
|
refs = [#ref{name = pubsub_subscription, label = '$subscriptions'}]}).
|
||||||
|
|
||||||
-xml(pubsub_affiliations,
|
-xml(pubsub_affiliations,
|
||||||
|
@ -3088,6 +3068,7 @@
|
||||||
dec = {dec_int, [0, infinity]},
|
dec = {dec_int, [0, infinity]},
|
||||||
enc = {enc_int, []}}]}).
|
enc = {enc_int, []}}]}).
|
||||||
|
|
||||||
|
-spec dec_tzo(_) -> {integer(), integer()}.
|
||||||
dec_tzo(Val) ->
|
dec_tzo(Val) ->
|
||||||
[H1, M1] = str:tokens(Val, <<":">>),
|
[H1, M1] = str:tokens(Val, <<":">>),
|
||||||
H = jlib:binary_to_integer(H1),
|
H = jlib:binary_to_integer(H1),
|
||||||
|
@ -3104,12 +3085,14 @@ enc_tzo({H, M}) ->
|
||||||
end,
|
end,
|
||||||
list_to_binary([Sign, io_lib:format("~2..0w:~2..0w", [H, M])]).
|
list_to_binary([Sign, io_lib:format("~2..0w:~2..0w", [H, M])]).
|
||||||
|
|
||||||
|
-spec dec_utc(_) -> erlang:timestamp().
|
||||||
dec_utc(Val) ->
|
dec_utc(Val) ->
|
||||||
{_, _, _} = jlib:datetime_string_to_timestamp(Val).
|
{_, _, _} = jlib:datetime_string_to_timestamp(Val).
|
||||||
|
|
||||||
enc_utc(Val) ->
|
enc_utc(Val) ->
|
||||||
jlib:now_to_utc_string(Val).
|
jlib:now_to_utc_string(Val).
|
||||||
|
|
||||||
|
-spec dec_jid(_) -> jid:jid().
|
||||||
dec_jid(Val) ->
|
dec_jid(Val) ->
|
||||||
case jid:from_string(Val) of
|
case jid:from_string(Val) of
|
||||||
error ->
|
error ->
|
||||||
|
@ -3121,6 +3104,7 @@ dec_jid(Val) ->
|
||||||
enc_jid(J) ->
|
enc_jid(J) ->
|
||||||
jid:to_string(J).
|
jid:to_string(J).
|
||||||
|
|
||||||
|
-spec resourceprep(_) -> binary().
|
||||||
resourceprep(R) ->
|
resourceprep(R) ->
|
||||||
case jid:resourceprep(R) of
|
case jid:resourceprep(R) of
|
||||||
error ->
|
error ->
|
||||||
|
@ -3129,6 +3113,7 @@ resourceprep(R) ->
|
||||||
R1
|
R1
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec dec_bool(_) -> boolean().
|
||||||
dec_bool(<<"false">>) -> false;
|
dec_bool(<<"false">>) -> false;
|
||||||
dec_bool(<<"0">>) -> false;
|
dec_bool(<<"0">>) -> false;
|
||||||
dec_bool(<<"true">>) -> true;
|
dec_bool(<<"true">>) -> true;
|
||||||
|
@ -3141,6 +3126,7 @@ join([], _Sep) -> <<>>;
|
||||||
join([H | T], Sep) ->
|
join([H | T], Sep) ->
|
||||||
<<H/binary, (<< <<Sep, X/binary>> || X <- T >>)/binary>>.
|
<<H/binary, (<< <<Sep, X/binary>> || X <- T >>)/binary>>.
|
||||||
|
|
||||||
|
-spec dec_ip(_) -> inet:ip_address().
|
||||||
dec_ip(S) ->
|
dec_ip(S) ->
|
||||||
{ok, Addr} = inet_parse:address(binary_to_list(S)),
|
{ok, Addr} = inet_parse:address(binary_to_list(S)),
|
||||||
Addr.
|
Addr.
|
||||||
|
@ -3151,6 +3137,33 @@ enc_ip({0,0,0,0,0,16#ffff,A,B}) ->
|
||||||
enc_ip(Addr) ->
|
enc_ip(Addr) ->
|
||||||
list_to_binary(inet_parse:ntoa(Addr)).
|
list_to_binary(inet_parse:ntoa(Addr)).
|
||||||
|
|
||||||
|
-spec re:split(_, _) -> binary().
|
||||||
|
-spec base64:decode(_) -> binary().
|
||||||
|
|
||||||
|
-spec dec_host_port(_) -> binary() | inet:ip_address() |
|
||||||
|
{binary() | inet:ip_address(), non_neg_integer()}.
|
||||||
|
dec_host_port(<<$[, T/binary>>) ->
|
||||||
|
[IP, <<$:, Port/binary>>] = binary:split(T, <<$]>>),
|
||||||
|
{dec_ip(IP), dec_int(Port, 0, 65535)};
|
||||||
|
dec_host_port(S) ->
|
||||||
|
case binary:split(S, <<$:>>) of
|
||||||
|
[S] ->
|
||||||
|
try dec_ip(S) catch _:_ -> S end;
|
||||||
|
[S, P] ->
|
||||||
|
{try dec_ip(S) catch _:_ -> S end, dec_int(P, 0, 65535)}
|
||||||
|
end.
|
||||||
|
|
||||||
|
enc_host_port(Host) when is_binary(Host) ->
|
||||||
|
Host;
|
||||||
|
enc_host_port({{_,_,_,_,_,_,_,_} = IPv6, Port}) ->
|
||||||
|
enc_host_port({<<$[, (enc_ip(IPv6))/binary, $]>>, Port});
|
||||||
|
enc_host_port({{_,_,_,_} = IPv4, Port}) ->
|
||||||
|
enc_host_port({enc_ip(IPv4), Port});
|
||||||
|
enc_host_port({Host, Port}) ->
|
||||||
|
<<Host/binary, $:, (integer_to_binary(Port))/binary>>;
|
||||||
|
enc_host_port(Addr) ->
|
||||||
|
enc_ip(Addr).
|
||||||
|
|
||||||
%% Local Variables:
|
%% Local Variables:
|
||||||
%% mode: erlang
|
%% mode: erlang
|
||||||
%% End:
|
%% End:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user