117 Commits

Author SHA1 Message Date
Jonas Platte
987d48666c
Split Endpoint trait into OutgoingRequest, IncomingRequest 2020-08-12 23:33:27 +02:00
florianjacob
467e7afd5e
Require std::error::Error for EndpointError
and implement it for ruma_api::error::FromHttpResponseError and Void.
This allows integrating EndpointErrors in the common rust error
ecosystem like thiserror and anyhow.
2020-08-12 14:00:44 +02:00
Jonas Platte
dffa60d70f
client-api: Update leave_room to new API conventions 2020-08-11 02:03:14 +02:00
Jonas Platte
b20768c1b1
Integrate ruma-client 2020-08-11 01:41:23 +02:00
Amanda Graven
fdc15123b0
Reorganize encyption related code
Some types used for encryption related tasks need to be used across more
internal crates than expected, so a few have been moved and renamed for
clarity.

* Rename the key_algorithms module in ruma-identifiers-validation to crypto_algorithms
* Move ruma_events::Algorithm to ruma-identifiers-validation and rename it EventEncryptionAlgorithm
* Move DeviceKeys from ruma-client-api to ruma-common
2020-08-10 18:38:53 +02:00
Jonas Platte
da78e215f8
Use thirdparty network types into ruma_common 2020-08-09 00:45:35 +02:00
Jonas Platte
1fbf05d71f
Fix some bad formatting 2020-08-08 21:52:58 +02:00
Jonas Platte
0366466792
Use toplevel imports in ruma_api! expansion 2020-08-08 21:23:07 +02:00
Jonas Platte
c39e9f5779
client-api: Move tests in get_public_rooms into tests module 2020-08-08 21:07:35 +02:00
Jonas Platte
f37fc6845f
Remove borrowing from API responses
To borrow these with correct lifetimes, we would need GATs
2020-08-08 21:04:45 +02:00
Jonas Platte
9384d24d04
Fix last commit not building with the unstable-pre-spec feature 2020-08-08 17:06:14 +02:00
Jonas Platte
a74dddd93b
Borrow strings and identifiers in more endpoints 2020-08-08 16:50:37 +02:00
Jonas Platte
6f805d2584
client-api: Simplify r0::room::create_room::CreationContent::into_event_content using the assign crate 2020-08-08 16:36:13 +02:00
Isaiah Inuwa
7eb945976c Use strong types in signatures fields 2020-08-08 15:54:31 +02:00
Isaiah Inuwa
7240184c1d Use DeviceKeyId and DeviceKeyAlgorithm from ruma-identifiers 2020-08-08 15:54:31 +02:00
Jonas Platte
349027f87d
Borrow strings and identifiers in send_state_event_* 2020-08-08 14:36:31 +02:00
Jonas Platte
2e683b2fd4
Borrow strings and identifiers in send_message_event 2020-08-08 14:28:07 +02:00
Jonas Platte
582cc9fe2a
Rename {create => send}_message_event, same for state 2020-08-08 14:27:00 +02:00
Devin Ragotzy
478385f0f2
Add room::aliases endpoint 2020-08-08 14:07:03 +02:00
Devin Ragotzy
7f0f5be1fe
Convert alias mod and get_public_rooms to use Outgoing trait 2020-08-07 22:08:03 +02:00
Jonas Platte
9bc6ce9201
Use identifier macros for tests 2020-08-05 00:12:44 +02:00
Jonas Platte
10184cb9ca
Use a dedicated method for conversion from Ruma request type to http::Request 2020-08-01 01:01:15 +02:00
timokoesters
8650ae00da
Make limit in user_directory/search a smart field 2020-07-30 19:05:49 +02:00
timokoesters
d5d2d1d893
Make is_empty helpers in sync_events public 2020-07-27 10:34:17 +02:00
Jonas Platte
42e07308e1
Remove unused import 2020-07-26 17:02:42 +02:00
Jonas Platte
e047c647dd
fixup 2020-07-26 16:34:56 +02:00
Jonas Platte
d7463ce37d
Remove things that can't be properly deprecated
See https://github.com/rust-lang/rust/issues/47236
2020-07-26 16:24:36 +02:00
Jonas Platte
2e0a765820
Fix mistakenly renamed struct 2020-07-26 16:04:12 +02:00
Jonas Platte
85e2ae3d48
Remove ugly commas 2020-07-24 21:13:41 +02:00
Jonas Platte
6286a2c692
Change deny attribute to warn in ruma-client-api 2020-07-24 20:31:07 +02:00
Kinrany
580aaf4858 Add trailing comma 2020-07-22 21:16:41 +02:00
Kinrany
dca8e8c53e Move PushRule from ruma_client_api to ruma_common
Moves ruma_client_api::r0::PushRule to ruma_common::push::AnyPushRule
2020-07-22 21:16:41 +02:00
Jonas Platte
4cbdc079b0
Improve string comparison impls 2020-07-22 19:17:24 +02:00
Bernardo Yusti
c74b737fa5
Add logout_devices parameter to change_password::Request 2020-07-21 01:40:23 +02:00
Isaiah Inuwa
ade43c8516 Use ServerName everywhere 2020-07-18 07:50:53 -05:00
Isaiah Inuwa
b6045d16a4 Use DeviceId instead of String for login response. 2020-07-18 07:25:28 -05:00
Jonas Platte
1e17afbc52
fixup! Mark types in ruma_events::room::create as non_exhaustive 2020-07-17 01:28:03 +02:00
skim
b260a13d4b
move and rename ruma_events::json::EventJson to ruma_common::raw::Raw 2020-07-16 07:31:36 -07:00
Devin R
101b8689a5 Add unstable-synapse-quirks feature for Sessions struct and fields 2020-07-15 19:17:03 -04:00
Devin R
254b24fb20 Add pre-spec fields to r0::keys::get_keys::Response 2020-07-15 19:14:57 -04:00
Ragotzy.devin
24b0068213
Add unstable backup and keys/upload_signing/signature endpoints
Co-authored-by: Timo Kosters <timo@koesters.xyz>
2020-07-15 15:53:35 +02:00
Jonas Platte
a3e5d679a1
Revert making identifier types generic over the underlying string type
At the same time, this commit makes `ServerName` a newtype around str so
other identifier types can borrow out their server name part as a
`&ServerName`. This technique works for `ServerName` because it keeps no
additional metadata. For the other identifier types to support being
created in borrowed form from a string slice, custom DSTs first have to
be added to Rust.
2020-07-14 23:02:51 +02:00
Jonas Platte
8683901e14
Don't to_string() string literals 2020-07-14 22:11:05 +02:00
Devin R
204a90ac43 Rename *EventStub -> Sync*Event 2020-07-14 13:44:39 -04:00
skim
7b909efccc
update type of limited in r0::sync::sync_events::Timeline from Option<bool> to bool 2020-07-13 14:35:27 -07:00
gnieto
6fd4b9b8b0
Properly serialize get_tags Response
`get_tags` route response was adding the `tags` property twice, which is
not the expected behaviour. This is an example of the previous
serialization of the `get_tags` route:

`{"tags":{"tags":{"u.example":{"order":0.55},"u.another":{"order":0.11}}}}`

The new serialization removes the outer `tags` property.
2020-07-05 13:20:47 +02:00
Jonas Platte
9ecc7c11cf
Add a constructor for get_message_events::Request 2020-07-03 22:06:47 +02:00
Jonas Platte
ba95fd6c4e
Add a constructor for create_room::Request 2020-07-03 22:03:15 +02:00
Ragotzy.devin
5376a3fc6e
Add colons to ruma_api! macro after each keyword 2020-06-30 13:06:37 +02:00
Ragotzy.devin
87fb2c1e00
Add #[ruma_api(body)] attr to get_room_event endpoint 2020-06-27 22:26:20 +02:00