This repository has been archived by the owner on Sep 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.8: completely overhaul event & content handling
- Big changes are afoot! This release decouples event metadata from event content, and decouples event content from the massive enum it once was. - Also, we now actually check the event type instead of using untagged enums. - Essentially, each possible matrix event now has its content struct somewhere in the types::content module. - Documentation exists, too!
- Loading branch information
Showing
17 changed files
with
691 additions
and
284 deletions.
There are no files selected for viewing
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,8 @@ | ||
language: rust | ||
rust: | ||
- stable | ||
- beta | ||
- nightly | ||
matrix: | ||
allow_failures: | ||
- rust: nightly |
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
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
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
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
This file was deleted.
Oops, something went wrong.
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,58 @@ | ||
//! Content types for `m.call.*` events. | ||
pub mod types; | ||
/// `m.call.invite` | ||
/// | ||
/// This event is sent by the caller when they wish to establish a call. | ||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Invite { | ||
/// A unique identifer for the call. | ||
call_id: String, | ||
/// The session description object | ||
offer: types::Offer, | ||
/// The version of the VoIP specification this message adheres to. This specification is version 0. | ||
version: i32, | ||
/// The time in milliseconds that the invite is valid for. Once the | ||
/// invite age exceeds this value, clients should discard it. They | ||
/// should also no longer show the call as awaiting an answer in the UI. | ||
lifetime: i32, | ||
} | ||
/// `m.call.candidates` | ||
/// | ||
/// This event is sent by callers after sending an invite and by the callee | ||
/// after answering. Its purpose is to give the other party additional ICE | ||
/// candidates to try using to communicate. | ||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Candidates { | ||
/// The ID of the call this event relates to. | ||
call_id: String, | ||
/// Array of objects describing the candidates. | ||
candidates: Vec<types::Candidate>, | ||
/// The version of the VoIP specification this messages adheres to. This specification is version 0. | ||
version: i32, | ||
} | ||
/// `m.call.answer` | ||
/// | ||
/// This event is sent by the callee when they wish to answer the call. | ||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Answer { | ||
/// The ID of the call this event relates to. | ||
call_id: String, | ||
/// The session description object | ||
answer: types::Answer, | ||
/// The version of the VoIP specification this message adheres to. This | ||
/// specification is version 0. | ||
version: i32, | ||
} | ||
/// `m.call.hangup` | ||
/// | ||
/// Sent by either party to signal their termination of the call. This can be | ||
/// sent either once the call has has been established or before to abort the | ||
/// call. | ||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Hangup { | ||
/// The ID of the call this event relates to. | ||
call_id: String, | ||
/// The version of the VoIP specification this message adheres to. This specification is version 0. | ||
version: i32, | ||
} |
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,31 @@ | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Offer { | ||
/// The type of session description. Must be 'offer'. | ||
#[serde(rename = "type")] | ||
session_type: String, | ||
/// The SDP text of the session description. | ||
sdp: String, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Candidate { | ||
/// The SDP media type this candidate is intended for. | ||
#[serde(rename = "sdpMid")] | ||
sdp_m_id: String, | ||
/// The index of the SDP 'm' line this candidate is intended for. | ||
#[serde(rename = "sdpMLineIndex")] | ||
sdp_m_line_index: i32, | ||
/// The SDP 'a' line of the candidate. | ||
candidate: String, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Answer { | ||
/// The type of session description. Must be 'answer'. | ||
#[serde(rename = "type")] | ||
session_type: String, | ||
/// The SDP text of the session description. | ||
sdp: String, | ||
} | ||
|
Oops, something went wrong.