crypto: Hide some methods that shouldn't be public.

master
Damir Jelić 2020-09-10 15:49:34 +02:00
parent 464e181f66
commit 23e953d9cf
1 changed files with 8 additions and 3 deletions

View File

@ -72,7 +72,7 @@ impl InboundGroupSession {
/// ///
/// * `session_key` - The private session key that is used to decrypt /// * `session_key` - The private session key that is used to decrypt
/// messages. /// messages.
pub fn new( pub(crate) fn new(
sender_key: &str, sender_key: &str,
signing_key: &str, signing_key: &str,
room_id: &RoomId, room_id: &RoomId,
@ -189,6 +189,11 @@ impl InboundGroupSession {
}) })
} }
/// The room where this session is used in.
pub fn room_id(&self) -> &RoomId {
&self.room_id
}
/// Returns the unique identifier for this session. /// Returns the unique identifier for this session.
pub fn session_id(&self) -> &str { pub fn session_id(&self) -> &str {
&self.session_id &self.session_id
@ -207,7 +212,7 @@ impl InboundGroupSession {
/// # Arguments /// # Arguments
/// ///
/// * `message` - The message that should be decrypted. /// * `message` - The message that should be decrypted.
pub async fn decrypt_helper( pub(crate) async fn decrypt_helper(
&self, &self,
message: String, message: String,
) -> Result<(String, u32), OlmGroupSessionError> { ) -> Result<(String, u32), OlmGroupSessionError> {
@ -219,7 +224,7 @@ impl InboundGroupSession {
/// # Arguments /// # Arguments
/// ///
/// * `event` - The event that should be decrypted. /// * `event` - The event that should be decrypted.
pub async fn decrypt( pub(crate) async fn decrypt(
&self, &self,
event: &SyncMessageEvent<EncryptedEventContent>, event: &SyncMessageEvent<EncryptedEventContent>,
) -> MegolmResult<(Raw<AnySyncRoomEvent>, u32)> { ) -> MegolmResult<(Raw<AnySyncRoomEvent>, u32)> {