This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Support media api, do some refactor and write API as unimplemented.
- Loading branch information
Showing
23 changed files
with
261 additions
and
100 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//! API client endpoints for the 0.x.x version of the Matrix spec. | ||
pub use self::account::{ | ||
AccountPassword, | ||
DeactivateAccount, | ||
PutAccountData, | ||
PutRoomAccountData, | ||
}; | ||
pub use self::directory::{GetRoomAlias, DeleteRoomAlias, PutRoomAlias}; | ||
pub use self::event_creation::{SendMessageEvent, StateMessageEvent}; | ||
pub use self::join::{InviteToRoom, JoinRoom, JoinRoomWithIdOrAlias, KickFromRoom, LeaveRoom}; | ||
pub use self::login::Login; | ||
pub use self::logout::Logout; | ||
pub use self::members::Members; | ||
pub use self::presence::{GetPresenceList, GetPresenceStatus, PostPresenceList, PutPresenceStatus}; | ||
pub use self::profile::{Profile, GetAvatarUrl, PutAvatarUrl, GetDisplayName, PutDisplayName}; | ||
pub use self::registration::Register; | ||
pub use self::room_creation::CreateRoom; | ||
pub use self::room_info::RoomState; | ||
pub use self::tags::{DeleteTag, GetTags, PutTag}; | ||
pub use self::sync::Sync; | ||
pub use self::versions::Versions; | ||
pub use self::filter::{GetFilter, PostFilter}; | ||
|
||
mod account; | ||
mod directory; | ||
mod event_creation; | ||
mod filter; | ||
mod join; | ||
mod login; | ||
mod logout; | ||
mod members; | ||
mod presence; | ||
mod profile; | ||
mod registration; | ||
mod room_creation; | ||
mod room_info; | ||
mod tags; | ||
mod sync; | ||
mod versions; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//! Endpoints for content. | ||
use iron::{Chain, Handler, IronError, IronResult, Request, Response}; | ||
|
||
use error::ApiError; | ||
use middleware::{AccessTokenAuth, MiddlewareChain}; | ||
|
||
/// The `/upload` endpoint. | ||
pub struct Upload; | ||
|
||
middleware_chain!(Upload, [AccessTokenAuth]); | ||
|
||
impl Handler for Upload { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} | ||
|
||
/// The `/download/:server_name/:media_id` endpoint. | ||
pub struct Download; | ||
|
||
middleware_chain!(Download, [AccessTokenAuth]); | ||
|
||
impl Handler for Download { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} | ||
|
||
/// The `/download/:server_name/:media_id/:file_name` endpoint. | ||
pub struct DownloadFile; | ||
|
||
middleware_chain!(DownloadFile, [AccessTokenAuth]); | ||
|
||
impl Handler for DownloadFile { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//! API media endpoints for the 0.x.x version of the Matrix spec. | ||
pub use self::content::{ | ||
Download, | ||
DownloadFile, | ||
Upload, | ||
}; | ||
pub use self::thumbnail::Thumbnail; | ||
pub use self::preview_url::PreviewUrl; | ||
|
||
mod content; | ||
mod preview_url; | ||
mod thumbnail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Endpoints for content. | ||
use iron::{Chain, Handler, IronError, IronResult, Request, Response}; | ||
|
||
use error::ApiError; | ||
use middleware::{AccessTokenAuth, MiddlewareChain}; | ||
|
||
/// The `/preview_url` endpoint. | ||
pub struct PreviewUrl; | ||
|
||
middleware_chain!(PreviewUrl, [AccessTokenAuth]); | ||
|
||
impl Handler for PreviewUrl { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Endpoints for content. | ||
use iron::{Chain, Handler, IronError, IronResult, Request, Response}; | ||
|
||
use error::ApiError; | ||
use middleware::{AccessTokenAuth, MiddlewareChain}; | ||
|
||
/// The `/thumbnail/:server_name/:media_id` endpoint. | ||
pub struct Thumbnail; | ||
|
||
middleware_chain!(Thumbnail, [AccessTokenAuth]); | ||
|
||
impl Handler for Thumbnail { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,50 @@ | ||
//! API endpoints for the 0.x.x version of the Matrix spec. | ||
pub use self::account::{ | ||
pub use self::client::{ | ||
AccountPassword, | ||
CreateRoom, | ||
DeactivateAccount, | ||
DeleteRoomAlias, | ||
DeleteTag, | ||
GetAvatarUrl, | ||
GetDisplayName, | ||
GetFilter, | ||
GetPresenceList, | ||
GetPresenceStatus, | ||
GetRoomAlias, | ||
GetTags, | ||
InviteToRoom, | ||
JoinRoom, | ||
JoinRoomWithIdOrAlias, | ||
KickFromRoom, | ||
LeaveRoom, | ||
Login, | ||
Logout, | ||
Members, | ||
PostFilter, | ||
PostPresenceList, | ||
Profile, | ||
PutAccountData, | ||
PutAvatarUrl, | ||
PutDisplayName, | ||
PutPresenceStatus, | ||
PutRoomAccountData, | ||
PutRoomAlias, | ||
PutTag, | ||
Register, | ||
RoomState, | ||
SendMessageEvent, | ||
StateMessageEvent, | ||
Sync, | ||
Versions, | ||
}; | ||
pub use self::media::{ | ||
Download, | ||
DownloadFile, | ||
PreviewUrl, | ||
Thumbnail, | ||
Upload, | ||
}; | ||
pub use self::directory::{GetRoomAlias, DeleteRoomAlias, PutRoomAlias}; | ||
pub use self::event_creation::{SendMessageEvent, StateMessageEvent}; | ||
pub use self::join::{InviteToRoom, JoinRoom, JoinRoomWithIdOrAlias, KickFromRoom, LeaveRoom}; | ||
pub use self::login::Login; | ||
pub use self::logout::Logout; | ||
pub use self::members::Members; | ||
pub use self::presence::{GetPresenceList, GetPresenceStatus, PostPresenceList, PutPresenceStatus}; | ||
pub use self::profile::{Profile, GetAvatarUrl, PutAvatarUrl, GetDisplayName, PutDisplayName}; | ||
pub use self::registration::Register; | ||
pub use self::room_creation::CreateRoom; | ||
pub use self::room_info::RoomState; | ||
pub use self::tags::{DeleteTag, GetTags, PutTag}; | ||
pub use self::sync::Sync; | ||
pub use self::versions::Versions; | ||
pub use self::filter::{GetFilter, PostFilter}; | ||
|
||
mod account; | ||
mod directory; | ||
mod event_creation; | ||
mod filter; | ||
mod join; | ||
mod login; | ||
mod logout; | ||
mod members; | ||
mod presence; | ||
mod profile; | ||
mod registration; | ||
mod room_creation; | ||
mod room_info; | ||
mod tags; | ||
mod sync; | ||
mod versions; | ||
mod media; | ||
mod client; |
Oops, something went wrong.