diff --git a/src/routes/account.rs b/src/routes/account.rs index dff2adc7b1933742b8a2a6d1d4581a14be22eb34..dff40f6df7db28e0d997a26e3b5b0ad05aa4d385 100644 --- a/src/routes/account.rs +++ b/src/routes/account.rs @@ -216,11 +216,6 @@ pub struct Login { password: String, } -#[options("/login")] -pub fn login_preflight() -> Response { - Response::Result(super::Status::Ok) -} - /// login to a Revolt account /// (1) find user by email /// (2) verify password @@ -295,3 +290,9 @@ pub fn token(info: Json<Token>) -> Response { })) } } + +#[options("/create")] pub fn create_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/verify/<_code>")] pub fn verify_email_preflight(_code: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/resend")] pub fn resend_email_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/login")] pub fn login_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/token")] pub fn token_preflight() -> Response { Response::Result(super::Status::Ok) } diff --git a/src/routes/channel.rs b/src/routes/channel.rs index 971ce174573a4c6f6a9ea55d9dd6c365abcf3759..eba1d5c5a335dff8b2d100488fee8c3fb25361bb 100644 --- a/src/routes/channel.rs +++ b/src/routes/channel.rs @@ -686,3 +686,9 @@ pub fn delete_message(user: UserRef, target: ChannelRef, message: Message) -> Op )), } } + +#[options("/create")] pub fn create_group_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>")] pub fn channel_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/recipients/<_member>")] pub fn member_preflight(_target: String, _member: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/messages")] pub fn messages_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/messages/<_message>")] pub fn message_preflight(_target: String, _message: String) -> Response { Response::Result(super::Status::Ok) } diff --git a/src/routes/guild.rs b/src/routes/guild.rs index eb0d49c8a2e16900ebcb365830bcc1c8913e3e3b..5e8cfe0b2fca58627d11a2647d009dc1a1ac563e 100644 --- a/src/routes/guild.rs +++ b/src/routes/guild.rs @@ -838,3 +838,14 @@ pub fn unban_member(user: UserRef, target: GuildRef, other: String) -> Option<Re )) } } + +#[options("/<_target>")] pub fn guild_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/channels")] pub fn create_channel_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/channels/<_channel>/invite")] pub fn create_invite_preflight(_target: String, _channel: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/invites/<_code>")] pub fn remove_invite_preflight(_target: String, _code: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/invites")] pub fn fetch_invites_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/join/<_code>", rank = 1)] pub fn invite_preflight(_code: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/create")] pub fn create_guild_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/members")] pub fn fetch_members_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/members/<_other>")] pub fn fetch_member_preflight(_target: String, _other: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/members/<_other>/ban")] pub fn ban_member_preflight(_target: String, _other: String) -> Response { Response::Result(super::Status::Ok) } diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 8ae073c82fc50bbfb4cee19e038619bda3a54acd..5b9d71341dfa3d4f9fc9c8b9e56069aaac2b8fd2 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -71,7 +71,11 @@ pub fn mount(rocket: Rocket) -> Rocket { account::login, account::token, + account::create_preflight, + account::verify_email_preflight, + account::resend_email_preflight, account::login_preflight, + account::token_preflight, ], ) .mount( @@ -87,7 +91,14 @@ pub fn mount(rocket: Rocket) -> Rocket { user::add_friend, user::remove_friend, user::block_user, - user::unblock_user + user::unblock_user, + + user::user_preflight, + user::lookup_preflight, + user::dms_preflight, + user::dm_preflight, + user::friend_preflight, + user::block_user_preflight, ], ) .mount( @@ -102,7 +113,13 @@ pub fn mount(rocket: Rocket) -> Rocket { channel::get_message, channel::send_message, channel::edit_message, - channel::delete_message + channel::delete_message, + + channel::create_group_preflight, + channel::channel_preflight, + channel::member_preflight, + channel::messages_preflight, + channel::message_preflight, ], ) .mount( @@ -122,7 +139,18 @@ pub fn mount(rocket: Rocket) -> Rocket { guild::fetch_member, guild::kick_member, guild::ban_member, - guild::unban_member + guild::unban_member, + + guild::guild_preflight, + guild::create_channel_preflight, + guild::create_invite_preflight, + guild::remove_invite_preflight, + guild::fetch_invites_preflight, + guild::invite_preflight, + guild::create_guild_preflight, + guild::fetch_members_preflight, + guild::fetch_member_preflight, + guild::ban_member_preflight, ], ) } diff --git a/src/routes/user.rs b/src/routes/user.rs index e41b1451067e09c01491e089155b7393e894e93b..fcf237e7f25e6298ad798f434b7868a70ab1fa7d 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -705,3 +705,10 @@ pub fn unblock_user(user: UserRef, target: UserRef) -> Response { | Relationship::NONE => Response::BadRequest(json!({ "error": "This has no effect." })), } } + +#[options("/<_target>")] pub fn user_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/lookup")] pub fn lookup_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/@me/dms")] pub fn dms_preflight() -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/dm")] pub fn dm_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/friend")] pub fn friend_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) } +#[options("/<_target>/block")] pub fn block_user_preflight(_target: String) -> Response { Response::Result(super::Status::Ok) }