2810 Commits

Author SHA1 Message Date
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
Ana Gelez
0e6d3f17c6 Seal the RulesetMember trait
+ use maplit instead of custom macro
+ fix two little issues in the documentation
2020-11-27 20:52:06 +01:00
Ana Gelez
65ef5f21e5 Use Self constructors when possible 2020-11-27 20:52:06 +01:00
Ana Gelez
1a29875fb4 Rename PushRule to SimplePushRule 2020-11-27 20:52:06 +01:00
Ana Gelez
5d988db5e7 impl Extend for Ruleset 2020-11-27 20:52:01 +01:00
Ana Gelez
0e0491c02b Add a "add" method on Ruleset
- Add wrapper types for each kind of push rule
- Add a trait to add a push rule to a rule set
2020-11-27 20:50:10 +01:00
Ana Gelez
98082e0081 Implement IntoIterator for Ruleset 2020-11-27 20:46:58 +01:00
Ana Gelez
e8622ee809 Use a BTreeSet instead of a Vec to make push rule IDs unique
- Introduce a new macro to easily derive Ord, PartialOrd, Eq and PartialEq
  for a PushRule-like type (these traits are required by BTreeSet)
- Introduce a new macro to easily build a BTreeSet
2020-11-27 20:46:58 +01:00
Jonas Platte
e7f55ea2c6
Rewrap comments 2020-11-27 18:22:18 +01:00
Jonas Platte
6c4bd7c72c
events: Allow m.new_content to change the message type 2020-11-26 17:52:08 +01:00
Jonas Platte
48d1c97475
events: Add rudimentary support for m.new_content 2020-11-25 18:40:48 +01:00
Jonas Platte
1f14cb0393
events: Simplify html constructors for text & notice message event contents 2020-11-25 18:40:16 +01:00
Jonas Platte
199f5840dd
events: Make text & notice message event content non-exhaustive 2020-11-25 18:38:14 +01:00
Gelez
d519a47a00
Remove circle-artifacts.com links in the documentation
Add a link to the MSC that defines these endpoints as they aren't
available in the unstable spec yet.
2020-11-25 18:19:41 +01:00
Jonas Platte
ee6d258bdf
events: Remove some needless Result wrapping 2020-11-25 18:10:19 +01:00
Gelez
4c41bfd1f3
Add constructors for default push rules 2020-11-24 22:37:09 +01:00
Jonas Platte
abc18fae39
Fix some links in documentation 2020-11-24 03:25:02 +01:00
Jonas Platte
c322bd4d1e
events: Feature-gate reactions
and make relationships module public. The re-export idea doesn't make
sense with annotations being used in both reactions and messages.
2020-11-24 03:25:02 +01:00
Jonas Platte
b7e15efe43
events: Support attributes on items in event_enum! 2020-11-24 03:25:02 +01:00
Jonas Platte
1dee89393a
events: Fix recently broken tests 2020-11-24 03:24:58 +01:00
Jonas Platte
60d12470c9
events: Allow missing fields in m.room.third_party_invite under unstable-synapse-quirks 2020-11-23 19:32:28 +01:00
Jonas Platte
634c3f1ee5
events: Allow m.room.tombstone without a body under unstable-synapse-quirks 2020-11-23 19:31:44 +01:00
Jonas Platte
f2c2f2df2f
common: Don't change fields in thirdparty::Protocol with unstable-synapse-quirks 2020-11-23 19:12:19 +01:00
Jonas Platte
ee4280cea2
events: Allow the url in m.room.avatar to be null / missing
This isn't allowed in any version of the spec, but it's the only way to
unset an avatar and will have to be supported in the future.

C.f. https://github.com/matrix-org/matrix-doc/issues/2006
2020-11-23 14:18:41 +01:00
Jonas Platte
0ae0a89467
events: Remove accidentally copy-pasted docs line 2020-11-23 14:15:54 +01:00
Alejandro Domínguez
d16fd4b2c1 Enable support in power level events for old Synapse events with strings 2020-11-20 14:31:10 +01:00
Alejandro Domínguez
872701dc83 Introduce the unstable-synapse-quirks feature in ruma-events 2020-11-20 14:31:10 +01:00
Alejandro Domínguez
51573238a9 Add function to deserialize BTreeMap with values of numbers and strings to integers 2020-11-20 14:31:10 +01:00
Alejandro Domínguez
0ac2f401f8 Add function to deserialize numbers and strings as an integer 2020-11-20 14:31:10 +01:00
Jonas Platte
d809066c9c
federation-api: Minor fixes to create_join_event 2020-11-18 19:36:32 +01:00
Guillem Nieto
34c4b6c110 Remove PduStub
Removed PduStub because is not used anymore on any public endpoint.
2020-11-18 19:30:23 +01:00
Guillem Nieto
b168c38d83 Use Pdu on create_join_event endpoints
Sending requests to this endpoints to Synapse/Dendrite homeservers leads
to some deserialization errors.

After claryfing it
(https://github.com/matrix-org/matrix-doc/issues/2856), `room_id` and
`event_id` fields are expected to appear on request's body and also on
path params. It seems that there's some initiative, in any case, to
remove the parameters from path:
https://github.com/matrix-org/matrix-doc/issues/2330
2020-11-18 19:30:23 +01:00
Jonas Platte
9a4206b1b2
events: Add a test for edit deserialization without unstable-pre-spec 2020-11-18 14:13:15 +01:00
Jonas Platte
0f64a6ea39
Fix new clippy warnings 2020-11-10 16:48:35 +01:00
Jonas Platte
f2a8dd7a55
signatures: Simplify key version validity check 2020-11-10 14:21:03 +01:00
Damir Jelić
71a8d9d6ce events: Add support for the m.reaction event type 2020-11-10 13:30:52 +01:00
Damir Jelić
cf7d4b40e1 events: Add support for the new relation types 2020-11-10 13:30:52 +01:00
Jonas Platte
a5c08c8fde
identifiers: Refactor Error enum 2020-11-08 19:32:09 +01:00