Commit graph

562 commits

Author SHA1 Message Date
Emmanuel Gil Peyrot
b7b3340c9f Add a blocking command parser (XEP-0191). 2017-10-31 15:48:11 +00:00
Emmanuel Gil Peyrot
f85b451fcf Add a new check_no_attributes macro, to avoid the empty list. 2017-10-31 15:47:38 +00:00
Emmanuel Gil Peyrot
1892e1ca04 disco: Check for children ordering in disco#info. 2017-10-29 00:36:36 +01:00
Emmanuel Gil Peyrot
a8cfc8e62e pubsub::event: Add more type safety. 2017-10-10 19:45:08 +01:00
Emmanuel Gil Peyrot
e1477f146b pubsub::event: Use the new helper macros to simplify parsing. 2017-10-10 19:27:29 +01:00
Emmanuel Gil Peyrot
5f6f6a5e91 disco: Use the new helper macros to simplify parsing. 2017-10-10 19:00:42 +01:00
Emmanuel Gil Peyrot
9f27f200ca data_forms: Use the new helper macros to simplify parsing. 2017-10-10 18:26:05 +01:00
Emmanuel Gil Peyrot
a2c7529668 eme: Use the new helper macros to simplify parsing. 2017-10-10 18:10:52 +01:00
Emmanuel Gil Peyrot
ee243c4720 chatstates: Use the new helper macros to simplify parsing. 2017-10-10 18:09:58 +01:00
Emmanuel Gil Peyrot
a2b6033336 caps: Use the new helper macros to simplify parsing. 2017-10-10 18:04:27 +01:00
Emmanuel Gil Peyrot
66fb8fea74 message_correct: Use the new helper macros to simplify parsing. 2017-10-10 18:00:15 +01:00
Emmanuel Gil Peyrot
cfbfce512e lib, ping, attention: Add a macro for singleton elements. 2017-10-10 17:53:25 +01:00
Emmanuel Gil Peyrot
6add31b526 lib: Add check macros, to simplify code. 2017-10-10 17:52:14 +01:00
Emmanuel Gil Peyrot
33018a5c09 roster: Make subscription="none" the default, see RFC6121 §2.1.2.5. 2017-10-10 17:40:29 +01:00
Emmanuel Gil Peyrot
92277ccde0 jingle_ft: Add support for empty range elements.
These can be used to indicate support for ranged transfers.
2017-08-27 02:33:37 +01:00
Emmanuel Gil Peyrot
f51fa15b68 jingle_ft: Add forgotten xml:lang support for <desc/>. 2017-08-27 01:22:15 +01:00
Emmanuel Gil Peyrot
833ef068c6 message: Fix wrong element for xml:lang. 2017-08-27 01:21:07 +01:00
Emmanuel Gil Peyrot
f69f567448 Use minidom 0.6.1’s Element::has_ns(), to simplify namespace comparisons. 2017-08-27 01:04:56 +01:00
Emmanuel Gil Peyrot
c853a1ff4b compare_elements: Add missing license notice. 2017-08-27 01:32:15 +01:00
Astro
1b1661fd82 Introduce comparing with namespace support. 2017-08-19 00:04:18 +01:00
Emmanuel Gil Peyrot
1af06fdf6d Add an iq version parser (XEP-0092). 2017-07-29 11:45:45 +01:00
Emmanuel Gil Peyrot
69cc83c456 message, iq, presence, stanza_error, forwarded: Add support for components hidden behind the component feature flag. 2017-07-29 06:49:02 +01:00
Emmanuel Gil Peyrot
99b9525e6f Update to jid-rs 0.2.3, which implements IntoAttributeValue on Jid. 2017-07-29 06:28:20 +01:00
Emmanuel Gil Peyrot
d55fa8e5dd chatstates: Prevent compilation if the module isn’t properly documented. 2017-07-29 06:26:50 +01:00
Emmanuel Gil Peyrot
a04c395122 roster: Document most structs and their fields. 2017-07-29 06:22:35 +01:00
Emmanuel Gil Peyrot
56a66f8c4b message: Enforce more type safety on Body, Subject and Thread. 2017-07-29 06:11:48 +01:00
Emmanuel Gil Peyrot
6ec1e46953 roster: Make Group a proper struct. 2017-07-29 05:36:59 +01:00
Emmanuel Gil Peyrot
5388696b95 lib: Remove erroneous “reference” mention in the module docstring. 2017-07-29 05:24:20 +01:00
Emmanuel Gil Peyrot
45d196463c disco: Document every struct and their fields. 2017-07-29 04:51:51 +01:00
Emmanuel Gil Peyrot
67e72b009e disco: Fix serialisation of extensions, and add a test. 2017-07-29 04:39:50 +01:00
Emmanuel Gil Peyrot
4d3717d170 disco: Split Feature and Identity parsing out of DiscoQueryResult. 2017-07-29 04:35:15 +01:00
Emmanuel Gil Peyrot
5ece20a029 disco: Create a mutable DiscoInfoResult at the beginning of its parsing. 2017-07-29 04:25:55 +01:00
Emmanuel Gil Peyrot
58760fc28d data_forms: Split field parsing into its own TryFrom impl. 2017-07-29 04:19:58 +01:00
Emmanuel Gil Peyrot
37d1ae64ad receipts: Split the stupid enum into two different structs. 2017-07-29 04:00:25 +01:00
Emmanuel Gil Peyrot
a0b1d93ff0 stanza_id: Split the stupid enum into two different structs. 2017-07-29 03:51:41 +01:00
Emmanuel Gil Peyrot
db35d28c9c ibb: Split the stupid enum into three different structs. 2017-07-29 03:44:35 +01:00
Emmanuel Gil Peyrot
dfb736a973 rsm: Change if .is_some() { .unwrap() } into if let Some(). 2017-07-29 03:03:45 +01:00
Emmanuel Gil Peyrot
f83fe92244 jingle: Wrap the disposition in a struct, to get better type safety. 2017-07-29 02:47:33 +01:00
Emmanuel Gil Peyrot
75ae6100b4 data_forms: Remove unneccessary swallowing of an error. 2017-07-29 02:41:42 +01:00
Emmanuel Gil Peyrot
4b3ced042e ecaps2, jingle_s5b: Replace drain() with into_iter(). 2017-07-26 00:04:20 +01:00
Emmanuel Gil Peyrot
83c9713ab9 caps, ecaps2: Make Blake2b panic and update the blake2 crate to 0.6.1.
See https://github.com/RustCrypto/hashes/issues/34 for more information.
2017-07-24 23:11:10 +01:00
Emmanuel Gil Peyrot
4454da15b6 disco: Implement disco#items. 2017-07-21 17:33:58 +01:00
Emmanuel Gil Peyrot
3b6733f38b Upgrade to minidom 0.4.4 to avoid having to redefine IntoElements for each Into<Element>. 2017-07-21 01:20:29 +01:00
Emmanuel Gil Peyrot
21cee25b27 Replace .and_then() with .map() wherever it makes sense. 2017-07-21 01:19:34 +01:00
Emmanuel Gil Peyrot
7612c53f9a attention, chatstates, eme, ping: Add a docstring on the structs. 2017-07-20 23:47:21 +01:00
Emmanuel Gil Peyrot
fd31e691af lib: Improve the wording of the docstring. 2017-07-20 23:46:44 +01:00
Emmanuel Gil Peyrot
87af0f3615 message, presence, iq: Improve documentation. 2017-07-20 23:10:13 +01:00
Emmanuel Gil Peyrot
5df585ca40 data_forms, ibr, message, presence, roster: Always use into_iter. 2017-07-20 23:09:22 +01:00
Emmanuel Gil Peyrot
f6f6faeb77 iq, jingle_ft: Simplify item counting with Iterator::count(). 2017-07-20 23:08:23 +01:00
Maxime “pep” Buquet
2571aa7666 presence: Add with_ helpers to build a Presence 2017-07-19 00:21:44 +01:00
Emmanuel Gil Peyrot
5543d71599 attention: Use super::* in tests like every other module. 2017-07-20 20:53:59 +01:00
Emmanuel Gil Peyrot
cc563b46d2 ecaps2, forwarding, jingle_s5b, mam: Replace complex into expressions with .map(Element::from). 2017-07-20 20:52:25 +01:00
Emmanuel Gil Peyrot
487dbdc6de Replace Into<Element> with From<…> for Element.
This allows Element::from() to work, and since Into<Element> is
automatically implemented for any type implementing From there is no
change to existing code.
2017-07-20 20:36:13 +01:00
Emmanuel Gil Peyrot
5ec921fa6f attention: Add missing unknown attribute check. 2017-07-20 20:11:00 +01:00
Emmanuel Gil Peyrot
1f43cd934b Use TryFrom from the try_from crate, instead of the unstable feature.
This makes xmpp-parsers usable on stable.
2017-07-20 20:03:15 +01:00
Emmanuel Gil Peyrot
0fcbf11644 iq: Split IqPayload into all three possible types. 2017-07-20 18:31:17 +01:00
Emmanuel Gil Peyrot
76a46559b8 disco: Split query and result. 2017-07-20 17:39:59 +01:00
Emmanuel Gil Peyrot
945ae350ac Add a jingle message parser and serialiser. 2017-07-15 11:38:44 +01:00
Emmanuel Gil Peyrot
161e5dcc9b jingle: Type Content::name better. 2017-07-15 11:37:29 +01:00
Emmanuel Gil Peyrot
244c9b2710 presence: Remove unused import in tests. 2017-06-27 22:21:35 +01:00
Maxime “pep” Buquet
98878042dd Use the generate_attribute macro in muc::user 2017-06-27 00:14:40 +01:00
Maxime “pep” Buquet
27cf9a6298 muc::Muc and muc::MucUser 2017-06-26 23:07:12 +01:00
Emmanuel Gil Peyrot
8ac4602240 presence: Add a simpler way to create a Presence. 2017-06-26 19:49:16 +01:00
Emmanuel Gil Peyrot
ad1d4adcec message: Add a simpler way to create a Message. 2017-06-26 19:47:26 +01:00
Emmanuel Gil Peyrot
96fe2d200e roster: Fix group serialisation and add a test. 2017-06-25 23:27:38 +01:00
Emmanuel Gil Peyrot
4338d9d638 jingle_s5b: Make jid a Jid and not a String. 2017-06-25 22:20:24 +01:00
Emmanuel Gil Peyrot
f6b222f49a jingle_ibb: Strengthen sid’s type safety. 2017-06-25 22:15:18 +01:00
Emmanuel Gil Peyrot
a219501fed jingle, jingle_ft: Use the new generate_id! macro to simplify Sid/Cid generation. 2017-06-25 22:14:51 +01:00
Emmanuel Gil Peyrot
95a19b4bb4 lib: Implement a generate_id! macro. 2017-06-25 22:14:21 +01:00
Emmanuel Gil Peyrot
3ea0c45337 jingle_s5b: Strengthen type safety for ids. 2017-06-25 21:38:58 +01:00
Emmanuel Gil Peyrot
f428ee070d Add an IBR parser. 2017-06-25 21:03:48 +01:00
Emmanuel Gil Peyrot
a48565e171 data_forms: Fix FORM_TYPE, <title/> and <instructions/> serialisation. 2017-06-25 20:13:43 +01:00
Emmanuel Gil Peyrot
13e8507848 chatstates: Improve parsing. 2017-06-25 19:55:55 +01:00
Emmanuel Gil Peyrot
17798190cf error: Implement fmt::Display and error::Error. 2017-06-17 03:36:12 +01:00
Emmanuel Gil Peyrot
6f69f2d7d9 jingle_ft: Parse <date/> into a proper DateTime. 2017-06-16 20:37:48 +01:00
Emmanuel Gil Peyrot
e7f0c45da5 jingle: Fix sid test. 2017-06-14 09:19:06 +01:00
Emmanuel Gil Peyrot
48d340120c jingle: Specialise Sid to get an increased type safety. 2017-06-14 02:28:42 +01:00
Emmanuel Gil Peyrot
216f6f8389 Fix build and compilation. 2017-06-14 01:57:02 +01:00
Emmanuel Gil Peyrot
393402032c jingle: Add a comment. 2017-06-14 00:59:37 +01:00
Emmanuel Gil Peyrot
ebc7582250 Move the Default implementation into more generate_attribute!. 2017-06-14 00:53:18 +01:00
Emmanuel Gil Peyrot
0f297d2d2d Add a generate_attribute! macro, and use it for the common case. 2017-06-14 00:50:57 +01:00
Emmanuel Gil Peyrot
9955c1131b ns: Remove now useless 'static lifetime. 2017-06-12 22:49:27 +01:00
Emmanuel Gil Peyrot
6c1c9d0851 Add a PubSub event parser and serialiser. 2017-06-11 14:48:31 +01:00
Emmanuel Gil Peyrot
334f2f78f8 data_forms: Implement IntoElements. 2017-06-11 14:42:11 +01:00
Emmanuel Gil Peyrot
88a3f507f6 idle, delay: Don’t import * from chrono::prelude. 2017-06-08 22:46:27 +02:00
Maxime “pep” Buquet
bd19341f69 Muc <x xmlns='http://jabber.org/protocol/muc#user'/> and <status /> parser 2017-05-31 02:54:47 +01:00
Maxime “pep” Buquet
c4c6528197 Muc <x xmlns='http://jabber.org/protocol/muc'/> parser 2017-05-30 22:02:56 +01:00
Emmanuel Gil Peyrot
33994c1042 hashes: Implement Eq and Hash. 2017-05-29 05:14:49 +01:00
Emmanuel Gil Peyrot
08ba164073 roster: Add a test for empty name == no name. 2017-05-29 03:42:11 +01:00
Emmanuel Gil Peyrot
7395e4b88f roster: Make an empty name be None instead.
RFC 6121 §2.4.1:
“Implementation Note: Including an empty 'name' attribute is equivalent
to including no 'name' attribute; both actions set the name to the
empty string.”
2017-05-29 03:40:34 +01:00
Emmanuel Gil Peyrot
073e208f06 iq: Wire up Roster. 2017-05-28 17:12:46 +01:00
Emmanuel Gil Peyrot
9eb8f39a38 presence: Make Show handle the None case, and rename PresenceType to Type. 2017-05-28 17:10:12 +01:00
Emmanuel Gil Peyrot
32bfa84551 presence: Rename Available to None, since that’s what it is. 2017-05-28 16:33:43 +01:00
Emmanuel Gil Peyrot
aae435c4d9 Add a roster parser/serialiser. 2017-05-28 16:30:43 +01:00
Emmanuel Gil Peyrot
ee34bc1a86 jingle_s5b: Remove unused .to_owned() during serialisation. 2017-05-28 01:47:12 +01:00
Emmanuel Gil Peyrot
6794b34714 Cargo.toml: Update minidom to 0.4.3 to use its new IntoAttributeValue implementation on numbers. 2017-05-27 23:18:15 +01:00
Emmanuel Gil Peyrot
8e1d5e7983 disco: Make xml:lang a proper Option and rename it to lang. 2017-05-27 22:10:00 +01:00
Emmanuel Gil Peyrot
d1a7d222f0 delay: Use chrono to parse the stamp. 2017-05-27 12:29:21 +01:00
Emmanuel Gil Peyrot
bdaced7603 caps, ecaps2: Add a function to create a Disco query from a hash. 2017-05-27 12:22:50 +01:00
Emmanuel Gil Peyrot
42235c42fb hashes: Implement From<Hash> for String. 2017-05-27 12:22:11 +01:00
Emmanuel Gil Peyrot
357568813d presence: Wire up legacy caps. 2017-05-27 12:21:32 +01:00
Emmanuel Gil Peyrot
2c77c4f701 idle: Add the chrono dependency to actually parse dates. 2017-05-27 12:20:19 +01:00
Emmanuel Gil Peyrot
dfdfd8cf71 Add a legacy caps parser and serialiser. 2017-05-25 02:34:03 +01:00
Emmanuel Gil Peyrot
764a7190e9 stanza_error: Simplify with IntoElements. 2017-05-25 01:14:36 +01:00
Emmanuel Gil Peyrot
56b7785942 delay: Remove clones. 2017-05-25 01:04:51 +01:00
Emmanuel Gil Peyrot
f08c81382c data_forms, media_element: Implement forgotten serialisation. 2017-05-25 01:00:17 +01:00
Emmanuel Gil Peyrot
b4e47e9a78 mam: Improve serialisation. 2017-05-25 00:41:13 +01:00
Emmanuel Gil Peyrot
a6b3152add hashes: Make the hash a Vec<u8>, to avoid base64 issues. 2017-05-25 00:30:29 +01:00
Emmanuel Gil Peyrot
070227ea03 eme: Remove two clones. 2017-05-25 00:30:00 +01:00
Emmanuel Gil Peyrot
b172a6e05c ecaps2: Remove the last clone. 2017-05-25 00:04:37 +01:00
Emmanuel Gil Peyrot
9bb65ea8fb jingle_ibb: Simplify parsing and remove clones. 2017-05-24 23:59:45 +01:00
Emmanuel Gil Peyrot
3678d9f0d3 stanza_error: Simplify attribute handling. 2017-05-24 23:56:35 +01:00
Emmanuel Gil Peyrot
898baddd3f disco: Split Into<Element> for Identity and Feature. 2017-05-24 23:47:27 +01:00
Emmanuel Gil Peyrot
17d6959606 jingle: Remove unused clones. 2017-05-24 23:38:44 +01:00
Emmanuel Gil Peyrot
9bd1e7f295 jingle_s5b: Remove the clones. 2017-05-24 23:00:38 +01:00
Emmanuel Gil Peyrot
947c49330f receipts: Parse 'id' using get_attr!(), and make it optional. 2017-05-24 22:43:21 +01:00
Emmanuel Gil Peyrot
47fc116906 media_element: Stop swallowing integer parsing errors. 2017-05-24 22:41:09 +01:00
Emmanuel Gil Peyrot
00f3f3eee6 jingle: Simplify parsing and serialisation. 2017-05-24 22:28:54 +01:00
Emmanuel Gil Peyrot
ecd98251bf rsm: Remove useless clones. 2017-05-24 21:44:35 +01:00
Emmanuel Gil Peyrot
6952f3adfc message_correct: Check for unwanted attributes. 2017-05-24 21:42:29 +01:00
Emmanuel Gil Peyrot
453a3635fd message: Remove extra clones, and simplify Into<Element>. 2017-05-24 21:40:11 +01:00
Emmanuel Gil Peyrot
8182213666 iq: Reintroduce a reference Into to get the type from the payload. 2017-05-24 21:35:09 +01:00
Emmanuel Gil Peyrot
21b92621f0 iq, message: Remove useless clone on unknown element. 2017-05-24 21:32:04 +01:00
Emmanuel Gil Peyrot
fbeeae5c64 presence: Simplify the code. 2017-05-24 21:30:33 +01:00
Emmanuel Gil Peyrot
16e43c0b01 Convert all of the parsers/serialisers into consuming their parameter. 2017-05-23 23:31:33 +01:00
Emmanuel Gil Peyrot
e3f1f31718 delay, eme, stanza_error: Use get_attr!. 2017-05-23 01:02:23 +01:00
Emmanuel Gil Peyrot
d61d09f5b7 hashes, presence, message, iq, disco: Use get_attr!. 2017-05-22 19:00:04 +01:00
Emmanuel Gil Peyrot
e7e4284a0d jingle_ft: Obtain attributes using the get_attr! macro. 2017-05-21 21:02:06 +01:00
Emmanuel Gil Peyrot
ca9a250efd jingle_s5b: Obtain attributes using the get_attr! macro. 2017-05-21 21:00:34 +01:00
Emmanuel Gil Peyrot
8c53d6e415 stanza_id: Use the new get_attr! macro to get attributes. 2017-05-21 20:56:04 +01:00
Emmanuel Gil Peyrot
185bd79c72 mam: Simplify attribute management, and make default mandatory. 2017-05-21 20:45:50 +01:00
Emmanuel Gil Peyrot
34ee6d52dc presence: Wire up idle as a payload. 2017-05-21 20:30:42 +01:00
Emmanuel Gil Peyrot
dc530a1912 Add an idle parser. 2017-05-21 20:22:48 +01:00
Emmanuel Gil Peyrot
545ce29282 message: Add forgotten origin-id payload. 2017-05-21 20:15:39 +01:00
Emmanuel Gil Peyrot
7cdb46b90a data_forms: Replace field_type String with a proper enum. 2017-05-21 17:08:05 +01:00
Emmanuel Gil Peyrot
80695edb72 chatstates, ping, presence: Check for extraneous attributes. 2017-05-21 16:44:35 +01:00
Emmanuel Gil Peyrot
814a3bd882 data_forms: Add support for required, options, title and instructions. 2017-05-21 16:41:29 +01:00
Emmanuel Gil Peyrot
a4f50f2d43 jingle_ibb, ibb, rsm: Simplify attribute parsing. 2017-05-21 16:08:25 +01:00
Emmanuel Gil Peyrot
3c083709cb rsm, ibb: Write and use a macro to parse attributes. 2017-05-21 16:03:17 +01:00
Emmanuel Gil Peyrot
16899f8c23 rsm: Add a test for <first/>. 2017-05-21 15:41:16 +01:00
Emmanuel Gil Peyrot
61839042bd rsm: Split First into two options, and generate Set earlier during parsing. 2017-05-21 15:30:22 +01:00
Emmanuel Gil Peyrot
d680c31cf9 iq, message: Wire up MAM to the payloads. 2017-05-19 02:58:35 +01:00
Emmanuel Gil Peyrot
967d4af843 rsm: Rename First id to make it more explicit. 2017-05-19 02:58:18 +01:00
Emmanuel Gil Peyrot
2b8bcebfd9 message, iq, presence: Return an Unknown instead of an error when the element is unknown. 2017-05-19 02:09:23 +01:00
Emmanuel Gil Peyrot
dcb7ac8db2 iq: Remove a panic! 2017-05-19 00:10:23 +01:00
Emmanuel Gil Peyrot
6df3c4a679 iq: Remove a bunch of clones. 2017-05-19 00:07:51 +01:00
Emmanuel Gil Peyrot
65469db1e3 iq: Stop parsing the payload automatically. 2017-05-19 00:04:42 +01:00
Emmanuel Gil Peyrot
4407183010 iq: Move IqPayload parsing into its own Into implementation. 2017-05-18 23:50:08 +01:00
Emmanuel Gil Peyrot
0ad6893d52 presence: Stop parsing payloads automatically. 2017-05-18 23:32:44 +01:00
Emmanuel Gil Peyrot
fe8dccd5df presence: Remove now-unused enum values. 2017-05-18 23:32:26 +01:00
Emmanuel Gil Peyrot
e52817e5cd message: Avoid identical match branches. 2017-05-18 23:14:07 +01:00
Emmanuel Gil Peyrot
f18043231c ecaps2: Avoid a useless clone. 2017-05-18 23:12:45 +01:00
Emmanuel Gil Peyrot
bbdf38d58b message: Stop parsing the payloads automatically. 2017-05-18 23:06:22 +01:00
Emmanuel Gil Peyrot
36b0bead49 message: Add stanza-id as a direct payload. 2017-05-18 23:09:30 +01:00
Emmanuel Gil Peyrot
b22acff15e hashes, ecaps2, jingle_ft: Make the algorithm a proper enum. 2017-05-18 23:09:29 +01:00
Emmanuel Gil Peyrot
4ec92b16ac Fix most clippy warnings. 2017-05-07 15:23:06 +01:00
Emmanuel Gil Peyrot
2b29748e6b message: Add support for the <thread/> element. 2017-05-07 15:09:18 +01:00
Emmanuel Gil Peyrot
da31e72357 message: Fix wrong parsing of the <body/> element, and add a test for it. 2017-05-07 15:06:11 +01:00
Emmanuel Gil Peyrot
4278c8ce2b message: Add support for the <subject/> element. 2017-05-07 15:10:04 +01:00
Emmanuel Gil Peyrot
3dfb05aab3 lib: Fix documentation. 2017-05-06 21:41:33 +01:00
Emmanuel Gil Peyrot
4142107965 message: Merge body in this module, and make it support xml:lang. 2017-05-06 21:38:23 +01:00
Emmanuel Gil Peyrot
69cfb14c77 presence: Switch to Into/TryFrom. 2017-05-06 21:24:17 +01:00
Emmanuel Gil Peyrot
f971cbd5c9 message: Switch to Into/TryFrom. 2017-05-06 21:21:34 +01:00
Emmanuel Gil Peyrot
fffaca316f iq: Switch to Into/TryFrom. 2017-05-06 21:16:56 +01:00
Emmanuel Gil Peyrot
04d90f22ee stanza_error: Switch to Into/TryFrom. 2017-05-06 21:13:53 +01:00
Emmanuel Gil Peyrot
418956c720 mam: Switch to Into/TryFrom. 2017-05-06 21:08:44 +01:00
Emmanuel Gil Peyrot
2b96751e5f eme: Switch to Into/TryFrom. 2017-05-06 21:03:42 +01:00
Emmanuel Gil Peyrot
2b49d8aa53 disco: Switch to Into/TryFrom. 2017-05-06 21:01:15 +01:00
Emmanuel Gil Peyrot
f963715e77 ecaps2: Switch to Into/TryFrom. 2017-05-06 20:58:22 +01:00
Emmanuel Gil Peyrot
2f05d02d23 forwarding: Switch to Into/TryFrom. 2017-05-06 20:53:43 +01:00
Emmanuel Gil Peyrot
8673b8f90e data_forms: Switch to Into/TryFrom. 2017-05-06 20:51:39 +01:00
Emmanuel Gil Peyrot
0dd0b444b3 media_element: Switch to Into/TryFrom. 2017-05-06 20:48:41 +01:00
Emmanuel Gil Peyrot
1ec3806629 hashes: Switch to Into/TryFrom. 2017-05-06 20:46:11 +01:00
Emmanuel Gil Peyrot
0f58e650b7 delay: Switch to Into/TryFrom. 2017-05-06 20:42:12 +01:00
Emmanuel Gil Peyrot
e451520187 chatstates: Switch to Into/TryFrom. 2017-05-06 20:33:58 +01:00
Emmanuel Gil Peyrot
a3a90e4eda jingle_ft: Switch to Into/TryFrom. 2017-05-06 20:30:52 +01:00
Emmanuel Gil Peyrot
4f11a067d8 message_correct: Switch to Into/TryFrom. 2017-05-06 20:16:45 +01:00
Emmanuel Gil Peyrot
de8fe4bf02 rsm: Switch to Into/TryFrom. 2017-05-06 20:14:45 +01:00
Emmanuel Gil Peyrot
7ebabf7e91 stanza_id: Switch to Into/TryFrom. 2017-05-06 20:10:35 +01:00
Emmanuel Gil Peyrot
151635f5fb receipts: Switch to Into/TryFrom. 2017-05-06 20:07:03 +01:00
Emmanuel Gil Peyrot
f99c667eab jingle: Make description and transport optional in content. 2017-05-06 14:58:18 +01:00
Emmanuel Gil Peyrot
8fbda37f6b jingle_ibb: Switch to Into/TryFrom. 2017-05-06 14:03:41 +01:00
Emmanuel Gil Peyrot
bb12168c41 jingle_s5b: Handle the forgotten case of an empty transport element, see §2.2. 2017-05-06 13:54:16 +01:00
Emmanuel Gil Peyrot
828b88e5b2 Add a Jingle SOCKS5 Bytestreams Transport implementation. 2017-05-06 12:49:30 +01:00
Emmanuel Gil Peyrot
51eecda4fd error: Implement From<std::string::ParseError>. 2017-05-06 12:48:42 +01:00
Emmanuel Gil Peyrot
e3acb55b49 ibb: Port to TryFrom/Into. 2017-05-04 23:11:10 +01:00
Emmanuel Gil Peyrot
033cbe777b ping: Port to TryFrom/Into. 2017-05-04 01:31:13 +01:00
Emmanuel Gil Peyrot
6c4fd8da01 jingle: Update to Into and TryFrom. 2017-05-04 01:20:28 +01:00
Emmanuel Gil Peyrot
29725b9d4d Update to minidom 0.3.0. 2017-05-04 01:20:22 +01:00
Emmanuel Gil Peyrot
765e8c3333 attention: Replace parse_* and serialise with TryFrom<Element> and Into<Element>. 2017-05-01 23:49:44 +01:00
Emmanuel Gil Peyrot
c0b7c9da88 iq: Remove unused variable causing a warning. 2017-05-01 01:50:38 +01:00
Emmanuel Gil Peyrot
7b6d444f03 delay: Use Jid for from attribute. 2017-05-01 01:50:18 +01:00
Emmanuel Gil Peyrot
f3b55350ad iq: Wire up stanza_error. 2017-05-01 01:23:56 +01:00
Emmanuel Gil Peyrot
42abbe2927 message: Wire up stanza_error. 2017-05-01 01:04:15 +01:00
Emmanuel Gil Peyrot
3dd0eb3a9b presence: Wire up stanza_error. 2017-05-01 01:02:35 +01:00
Emmanuel Gil Peyrot
2465885975 Add a stanza error parser and serialiser. 2017-05-01 01:24:45 +01:00
Emmanuel Gil Peyrot
e03a5a89e7 presence: Prevent two statuses from having the same lang. 2017-04-30 22:45:39 +01:00
Emmanuel Gil Peyrot
0abac5ad2d presence: Make statuses addressable by their xml:lang. 2017-04-30 22:07:32 +01:00
Emmanuel Gil Peyrot
1909ae33dc presence: make show, statuses and priority first-class elements. 2017-04-30 22:00:29 +01:00
Emmanuel Gil Peyrot
21398447e7 presence: Implement priority parsing. 2017-04-30 21:29:55 +01:00
Emmanuel Gil Peyrot
4ec3898c2f presence: Implement show parsing. 2017-04-30 21:03:04 +01:00
Emmanuel Gil Peyrot
0e20810a83 status, presence: Merge status into presence. 2017-04-30 20:33:53 +01:00
Emmanuel Gil Peyrot
4b90c1dc1f data_forms, disco, jingle, jingle_ft: Remove superfluous “extern crate”. 2017-04-29 22:10:38 +01:00
Emmanuel Gil Peyrot
407e4cceb4 License the project under MPL-2.0. 2017-04-29 22:14:34 +01:00
Emmanuel Gil Peyrot
7750aae5b5 presence, message, jingle_ft: Remove unneeded println!(). 2017-04-29 06:57:20 +01:00
Emmanuel Gil Peyrot
61efeb827f forwarding: Remove unused imports. 2017-04-29 06:50:57 +01:00
Emmanuel Gil Peyrot
eecb47f4ed mam: Add tests. 2017-04-29 06:41:55 +01:00
Emmanuel Gil Peyrot
0b2d46aa3a Add a MAM parser and serialiser. 2017-04-29 06:07:00 +01:00
Emmanuel Gil Peyrot
7cd4a49011 error: Add JidParseError. 2017-04-29 06:06:41 +01:00
Emmanuel Gil Peyrot
72a6eee2fd Add a RSM parser and serialiser. 2017-04-29 04:37:18 +01:00
Emmanuel Gil Peyrot
0f92a11894 Add a forwarding parser and serialiser. 2017-04-29 03:50:49 +01:00
Emmanuel Gil Peyrot
d824a161b6 message: Implement IntoElements. 2017-04-29 03:50:20 +01:00
Emmanuel Gil Peyrot
4dc585f1c9 delay: Implement IntoElements. 2017-04-29 03:50:02 +01:00
Emmanuel Gil Peyrot
8b964df645 Add a stanza-id parser and serialiser. 2017-04-29 03:23:50 +01:00
Emmanuel Gil Peyrot
b09c57ec72 ecaps2: Move hashing crates to the main library. 2017-04-29 01:31:39 +01:00
Emmanuel Gil Peyrot
45b38bcef9 iq: Wire up the IBB parser and serialiser. 2017-04-29 01:06:12 +01:00
Emmanuel Gil Peyrot
846148d618 ibb: Fix serialisation of <data/> data. 2017-04-28 23:46:32 +01:00
Emmanuel Gil Peyrot
5e4ba2701b iq: Wire up the Jingle parser and serialiser. 2017-04-28 23:46:06 +01:00
Emmanuel Gil Peyrot
4fb4727357 jingle: Remove extraneous println!. 2017-04-28 23:45:43 +01:00
Emmanuel Gil Peyrot
10a336f874 jingle: Accept any unknown child, as per the specification. 2017-04-28 23:45:27 +01:00
Emmanuel Gil Peyrot
c20d37a842 jingle: Add serialisation for <reason/>. 2017-04-28 23:45:02 +01:00
Emmanuel Gil Peyrot
de93c32cb5 jingle_ft: Add a received parser. 2017-04-28 23:43:47 +01:00
Emmanuel Gil Peyrot
eeb9b36620 jingle_ft: Make Creator into an enum, instead of a String. 2017-04-28 23:43:24 +01:00
Emmanuel Gil Peyrot
9f6eea06ce ns: Fix the hashes text-names namespaces. 2017-04-28 23:42:50 +01:00
Emmanuel Gil Peyrot
fe3300b4b0 jingle_ft: Add the forgotten desc element. 2017-04-28 23:42:27 +01:00
Emmanuel Gil Peyrot
30a596cb26 ibb: Implement serialise. 2017-04-27 19:05:51 +01:00
Emmanuel Gil Peyrot
6a48a6bf00 ecaps2, error: Update to base64 0.5. 2017-04-27 18:33:02 +01:00
Emmanuel Gil Peyrot
5d51dff9e6 disco: Bump minidom dependency to 0.2.0, which fixes xml:lang parsing. 2017-04-26 00:22:40 +01:00
Emmanuel Gil Peyrot
a0eab6c1af ecaps2: Import Digest from digest. 2017-04-26 00:20:50 +01:00
Emmanuel Gil Peyrot
7fc40dbb19 ecaps2: Remove extraneous borrowing on base64::encode. 2017-04-24 20:03:05 +01:00
Emmanuel Gil Peyrot
049ef23595 jingle_ft: Implement IntoElements on Range, and change size to be an u64. 2017-04-24 19:52:41 +01:00
Emmanuel Gil Peyrot
5abf820fad jingle_ft: Implement serialise. 2017-04-24 19:25:00 +01:00
Emmanuel Gil Peyrot
db1a87e2ee jingle: Implement serialise. 2017-04-24 19:25:00 +01:00
Emmanuel Gil Peyrot
fa10ab4ebc jingle: Implement From for String on all special attributes. 2017-04-24 19:25:00 +01:00
Emmanuel Gil Peyrot
90f1792ebc jingle_ibb: Make the fields in Transport public. 2017-04-24 19:25:00 +01:00
Emmanuel Gil Peyrot
2b19a415d4 jingle_ibb: Implement serialise. 2017-04-24 19:25:00 +01:00
Emmanuel Gil Peyrot
c71b32ae24 ibb: Implement IntoAttributeValue for Stanza. 2017-04-24 19:25:00 +01:00
Maxime “pep” Buquet
1b4c0c4589 iq: Clippify 2017-04-24 19:20:35 +01:00
Maxime “pep” Buquet
c462d230f1 ping, iq: Implement ping::serialise_ping and link to Iq. 2017-04-23 21:17:26 +01:00
Maxime “pep” Buquet
b259ab9ef2 iq: Link disco parser to Iq. 2017-04-23 21:12:27 +01:00
Maxime “pep” Buquet
04af2f3d26 Implement Iq stanzas parsing 2017-04-23 20:38:13 +01:00
Emmanuel Gil Peyrot
944cb3964e presence: Add status as a possible payload. 2017-04-23 19:32:48 +01:00
Emmanuel Gil Peyrot
93343f3a00 Add a status parser. 2017-04-23 19:28:25 +01:00
Emmanuel Gil Peyrot
948b54d073 ecaps2: Implement blake2b. 2017-04-23 19:28:03 +01:00
Emmanuel Gil Peyrot
2c95fd6786 presence: Add ecaps2 as a possible payload. 2017-04-23 18:38:53 +01:00
Emmanuel Gil Peyrot
429abb996d ecaps2: Implement serialise. 2017-04-23 18:36:37 +01:00
Emmanuel Gil Peyrot
20949c2832 hashes: Implement serialise. 2017-04-23 18:36:12 +01:00
Emmanuel Gil Peyrot
78e8a06ec2 Add a presence parser. 2017-04-23 17:30:23 +01:00
Emmanuel Gil Peyrot
6a56918484 ns: Add the namespaces of hashes functions we implement. 2017-04-23 17:30:07 +01:00
Emmanuel Gil Peyrot
c81509744f lib, message, jingle_ft: Remove unused imports. 2017-04-23 15:32:38 +01:00
Emmanuel Gil Peyrot
5e7ad720c3 Add a message parser, along with a dependency on jid. 2017-04-23 15:13:03 +01:00
Emmanuel Gil Peyrot
15634b6500 ping: Remove extraneous brackets. 2017-04-23 03:45:14 +01:00
Emmanuel Gil Peyrot
16a6ebd751 ibb: Simplify the FromStr using match. 2017-04-23 03:44:58 +01:00
Emmanuel Gil Peyrot
659eaee14e data_forms: Simplify the FromStr using match. 2017-04-23 03:42:50 +01:00
Emmanuel Gil Peyrot
90db24eed8 jingle: Simplify the FromStr using match. 2017-04-23 03:41:26 +01:00
Emmanuel Gil Peyrot
7e964b167a message_correct: Add a serialise function, and simplify the representation. 2017-04-23 03:23:13 +01:00
Emmanuel Gil Peyrot
4128c4b9ed chatstates: Add a serialise function. 2017-04-23 03:22:42 +01:00
Emmanuel Gil Peyrot
7002578bc0 body: Test the serialise function. 2017-04-23 03:22:25 +01:00
Emmanuel Gil Peyrot
cebccb363f eme: Add a serialise function. 2017-04-23 03:22:02 +01:00
Emmanuel Gil Peyrot
c6036194b1 delay: Add a serialise function. 2017-04-23 03:21:53 +01:00
Emmanuel Gil Peyrot
ab841dc375 receipts: Add a serialise function. 2017-04-23 03:21:21 +01:00
Emmanuel Gil Peyrot
54f4040251 attention: Simplify the payload type, and add a serialise function. 2017-04-23 03:20:52 +01:00
Emmanuel Gil Peyrot
ca6e65ad76 body: Add a serialise function. 2017-04-23 02:24:13 +01:00
Emmanuel Gil Peyrot
6d6ac8a380 body: Simplify the type of Body to an alias of String. 2017-04-22 20:49:17 +01:00
Emmanuel Gil Peyrot
24d563ff18 jingle: Carry the minidom Element for description, transport and security. 2017-04-22 19:30:17 +01:00
Emmanuel Gil Peyrot
ff5be32a0e Add a JingleIBB parser. 2017-04-22 19:15:48 +01:00
Emmanuel Gil Peyrot
22ec4b1913 ibb: Improve handling of optional stanza attribute. 2017-04-22 19:15:29 +01:00
Emmanuel Gil Peyrot
fbb609485b Add a JingleFT parser. 2017-04-22 17:39:21 +01:00
Emmanuel Gil Peyrot
000e5a50c2 error: Add ParseIntError to the possible errors. 2017-04-22 17:39:00 +01:00
Emmanuel Gil Peyrot
edc5961a79 hashes: Implement PartialEq on Hash. 2017-04-22 17:38:36 +01:00
Emmanuel Gil Peyrot
0778ceea7d jingle: Remove extraneous println!(). 2017-04-22 17:38:19 +01:00
Emmanuel Gil Peyrot
e1070a8b98 ecaps2: Add a parser too. 2017-04-22 16:51:10 +01:00
Emmanuel Gil Peyrot
ea2ff8a35d Add a hash parser. 2017-04-21 04:21:16 +01:00
Emmanuel Gil Peyrot
d39d13b7cb delay: Correctly parse the content data. 2017-04-21 04:01:14 +01:00
Emmanuel Gil Peyrot
cfadff3bc9 Add a Delayed Delivery parser. 2017-04-21 03:57:34 +01:00
Emmanuel Gil Peyrot
a680ab194c Add an Explicit Message Encryption parser. 2017-04-21 03:45:05 +01:00
Emmanuel Gil Peyrot
94380fdbd5 ibb: Add some more tests. 2017-04-21 03:21:06 +01:00
Emmanuel Gil Peyrot
189f17c569 ibb: Add a parser for the <close/> element. 2017-04-21 03:09:10 +01:00
Emmanuel Gil Peyrot
fb373c2b66 ibb: Add a parser for the <data/> element. 2017-04-21 03:07:21 +01:00
Emmanuel Gil Peyrot
6ba22a43e5 lib: Import base64 at the top-level, and not in a module. 2017-04-21 02:46:41 +01:00
Emmanuel Gil Peyrot
8fba5cf966 Add a Last Message Correction parser. 2017-04-21 02:07:44 +01:00
Emmanuel Gil Peyrot
9410b9682a lib: Export attention as a MessagePayload. 2017-04-21 01:56:18 +01:00
Emmanuel Gil Peyrot
458099cef0 Add an attention parser. 2017-04-21 01:53:47 +01:00
Emmanuel Gil Peyrot
6600418070 ecaps2: Remove function convert_element, used only in the tests. 2017-04-21 01:39:32 +01:00
Emmanuel Gil Peyrot
79c691e1c0 ecaps2: Add a TODO about changing algo into an enum. 2017-04-21 01:30:29 +01:00
Emmanuel Gil Peyrot
3209b04a50 Fix all warnings issued by cargo clippy. 2017-04-21 01:28:58 +01:00
Emmanuel Gil Peyrot
0da3d55e40 First attempt at a documentation. 2017-04-21 01:06:30 +01:00
Emmanuel Gil Peyrot
62d9385728 Make all parsed types implement Clone. 2017-04-21 00:41:15 +01:00
Emmanuel Gil Peyrot
88ae9aca3f ecaps2: Remove unused brackets around Blake2b. 2017-04-21 00:24:20 +01:00
Emmanuel Gil Peyrot
efedb215c4 ecaps2: Add Rust-Crypto and base64 dependencies, and implement hashing. 2017-04-21 00:01:57 +01:00
Emmanuel Gil Peyrot
7288c2c74f Import ns itself, and remove the _NS suffix on all namespaces. 2017-04-20 23:16:12 +01:00
Emmanuel Gil Peyrot
411e421732 ecaps2: Use a reference everywhere, instead of taking ownership. 2017-04-20 21:53:46 +01:00
Emmanuel Gil Peyrot
83cf57abd0 disco: Use a reference everywhere, instead of taking ownership. 2017-04-20 21:53:46 +01:00
Emmanuel Gil Peyrot
1190dd9001 disco: Add a serializer. 2017-04-20 21:03:02 +01:00
Emmanuel Gil Peyrot
e0e6119e55 disco: Relax the parsing rules for get disco#info. 2017-04-20 21:02:51 +01:00
Emmanuel Gil Peyrot
55f5435f6e body: Make the string public. 2017-04-20 01:31:03 +01:00
Emmanuel Gil Peyrot
f3c9a58862 Add a receipts parser. 2017-04-20 00:43:33 +01:00
Emmanuel Gil Peyrot
861c933c56 body, chatstates: Fix tests. 2017-04-20 00:43:17 +01:00
Emmanuel Gil Peyrot
a9993b1281 Remove the MessagePayload trait, it was a bad idea. 2017-04-20 00:14:47 +01:00
Emmanuel Gil Peyrot
b8b0494c19 Fix a stupid copy/paste syntax error. 2017-04-20 00:14:29 +01:00