2497 Commits

Author SHA1 Message Date
Jonas Platte
ae6595339c
Stop stripping serde attributes
To still prevent 'unknown attribute' errors, the attribute is registered
using a dummy derive macro where needed.
2020-12-13 11:54:39 +01:00
Jonas Platte
e8b1e35714
serde: Optimize btreemap_int_or_string_to_int_values
Don't allocate a temporary `BTreeMap<T, IntWrap>`.
2020-12-12 17:57:51 +01:00
Jonas Platte
22ab60128a
serde: Fix int_or_string_to_int deserialization helper
It's unclear why the previous method didn't work, but this one definitely does.
2020-12-12 17:45:16 +01:00
Jonas Platte
d220ab0fbe
Outgoing derive: Copy cfg and cfg_attr attributes to Incoming type 2020-12-10 16:40:57 +01:00
Jonas Platte
cf77181072
Revert "federation-api: Make pdus of transactions optional under unstable-pre-spec"
This reverts commit 5a65634a28cd007416fa2d4b665ab60e5d46d920.
2020-12-10 16:40:33 +01:00
Timo Kösters
5a65634a28
federation-api: Make pdus of transactions optional under unstable-pre-spec 2020-12-10 15:42:14 +01:00
Devin Ragotzy
724a48d616
Add examples to the docs of Raw and the ruma-events module 2020-12-07 17:57:23 +01:00
Jonas Platte
ee814aa849
client-api: Fix issue ID for lazy load deserialization bug 2020-12-07 13:25:10 +01:00
Jonas Platte
c274431949
client-api: Fix deserialization of LazyLoadOptions when serde(flatten)ed 2020-12-07 13:24:03 +01:00
Jonas Platte
ff78ab87dd
filter: Import serde_json functions for tests 2020-12-07 13:24:03 +01:00
David Vo
1a4e9aa20a
Implement MSC2448: BlurHashes for media
This exposes the pre-FCP unstable prefixed fields in MSC2448.
2020-12-07 13:01:15 +01:00
strct
018adf0819
Fix typo in docs 2020-12-07 10:51:41 +01:00
Jonas Platte
cc07d26af6
Allow empty request / response if all body parameters are optional 2020-12-06 22:33:27 +01:00
Devin Ragotzy
f17c5fc619
Use Raw<Pdu> in get_event Response over Pdu 2020-12-06 12:20:48 +01:00
Jonas Platte
e8882fe814
events: Regroup crate-local imports 2020-12-04 21:05:48 +01:00
Damir Jelić
9b87fdda12
ruma-events: Allow encrypted megolm events to contain a relation 2020-12-04 19:53:46 +01:00
Damir Jelić
3216edc137
ruma-events: Add support for m.key.verification.done events 2020-12-04 19:53:46 +01:00
Damir Jelić
ce2ab39d71
ruma-events: Add support for m.key.verification.ready events 2020-12-04 19:53:46 +01:00
Damir Jelić
e0adcaa502
ruma-events: Add the key verification room message variant 2020-12-04 19:53:45 +01:00
Damir Jelić
4afafa8b37
ruma-events: Add the majority of in-room verification events
This patch adds equivalent in-room versions of the m.key.verfication.*
events we have for to-device events.

The MSC that adds this is found over here:
https://github.com/matrix-org/matrix-doc/pull/2241
2020-12-04 19:53:43 +01:00
Damir Jelić
7ec2b0b555
ruma-events: Create separate to-device content structs
While it's possible to share the content between different event types
in the usual case some event types have slightly different contents if
they are sent out as a to-device event vs a room message event.

The canonical example for this are key verification events where the
to-device version has a transaction id field but the room message
version uses event relationships for the same purpose.

This patch makes it possible for to-device events to have different
content structs. Type aliases are used where a common struct can be
used.
2020-12-04 19:48:34 +01:00
Jonas Platte
5828f7b3b5
Bring set_pushrule in line with API conventions 2020-12-03 23:57:20 +01:00
Jonas Platte
fd47563439
Remove needless uses of #[serde(default)] 2020-12-03 23:22:43 +01:00
Jonas Platte
51ddcca9f5
Fix a typo 2020-12-03 22:28:23 +01:00
Jonas Platte
a315e6d6cd
Update recommended VSCode settings 2020-12-02 19:20:57 +01:00
Jonas Platte
8427f51ebd
client-api: Allow custom values for ThirdPartyIdRemovalStatus 2020-12-02 19:14:56 +01:00
Jonas Platte
e7b5a533d6
Move Outgoing test out of ruma_serde to avoid cyclic dev-dependency 2020-12-02 18:51:35 +01:00
Jonas Platte
55c1dd5ca7
identifiers: Feature-gate serde test under serde feature 2020-12-02 14:19:02 +01:00
Jonas Platte
62135a9630
Fix issues with new key ID / signature types 2020-12-02 13:50:58 +01:00
Jonas Platte
1ceade7b61
identifiers: Add more crypto-related types
Co-authored-by: Isaiah Inuwa <isaiah.inuwa@gmail.com>
2020-12-02 13:11:28 +01:00
Jonas Platte
63678df887
identifiers: Stop rejecting unknown crypto algorithms 2020-12-02 13:11:28 +01:00
Jonas Platte
4f11a5eb38
Clean up feature flags on ruma crate 2020-11-29 18:51:49 +01:00
Jonas Platte
d432598ae4
Feature-gate backup endpoints on unstable-pre-spec 2020-11-28 14:24:37 +01:00
Jonas Platte
5562a23aaa
Move Raw, Outgoing and all macro code from ruma-common to ruma-serde 2020-11-28 03:45:39 +01:00
Jonas Platte
ea778a0fdc
serde: Move string-related helpers into a new module 2020-11-28 02:01:12 +01:00
Jonas Platte
f8bf8b3fb8
federation-api: Rename SigningKey => ServerSigningKeys 2020-11-28 00:19:25 +01:00
Jonas Platte
8ccf0f128b
Normalize formatting of empty curly braces 2020-11-27 23:07:32 +01:00
Jonas Platte
675efbc5f1
events-macros: Improve readability, fix lines >100 chars 2020-11-27 23:07:09 +01:00
Jonas Platte
5175d3d622
api_macros: Improve readability, fix lines >100 chars 2020-11-27 23:06:31 +01:00
Jonas Platte
d749f733e2
Remove beta toolchain from CI
Since we never leave Nightly failing for long, this is exceedingly
unlikely to catch any issues not caught by the other toolchains.
2020-11-27 22:07:35 +01:00
Jonas Platte
a6ff054ba3
api-macros: Refactor metadata parsing
* duplicate field assignment will now raise an error
* parsing should now be faster (though it probably doesn't matter)
* the code is now split into more independent parts
2020-11-27 21:44:59 +01:00
Jonas Platte
761aecbe4e
api-macros: Remove RawApi, some refactoring 2020-11-27 21:15:37 +01:00
Jonas Platte
183f427143
api-macros: Rename RawErrorType => ErrorType 2020-11-27 21:15:37 +01:00
Jonas Platte
4d9fdeb61d
api-macros: Remove RawResponse 2020-11-27 21:15:37 +01:00
Jonas Platte
05249c6cdb
api-macros: Remove RawRequest 2020-11-27 21:15:37 +01:00
Jonas Platte
00ae067bce
api-macros: Remove RawMetadata 2020-11-27 21:15:37 +01:00
Jonas Platte
187809cff5
api-macros: Export METADATA as a regular constant
Rather than just as an associated constant in trait implementations.
2020-11-27 21:15:32 +01:00
Ana Gelez
aab6ed9c94 Hide RulesetMember::add_to in the docs 2020-11-27 20:53:51 +01:00
Ana Gelez
483fe8f940 Run cargo fmt 2020-11-27 20:53:51 +01:00
Ana Gelez
57efd8cd5b Custom iterator for Ruleset 2020-11-27 20:53:34 +01:00