Fix typo: visiblity -> visibility
This commit is contained in:
parent
aa16a7e291
commit
df8c489304
8 changed files with 16 additions and 16 deletions
|
@ -1159,24 +1159,24 @@ impl BaseClient {
|
|||
|
||||
match &*olm {
|
||||
Some(o) => {
|
||||
let (history_visiblity, settings) = self
|
||||
let (history_visibility, settings) = self
|
||||
.get_room(room_id)
|
||||
.map(|r| (r.history_visiblity(), r.encryption_settings()))
|
||||
.map(|r| (r.history_visibility(), r.encryption_settings()))
|
||||
.unwrap_or((HistoryVisibility::Joined, None));
|
||||
|
||||
let joined = self.store.get_joined_user_ids(room_id).await?;
|
||||
let invited = self.store.get_invited_user_ids(room_id).await?;
|
||||
|
||||
// Don't share the group session with members that are invited
|
||||
// if the history visiblity is set to `Joined`
|
||||
let members = if history_visiblity == HistoryVisibility::Joined {
|
||||
// if the history visibility is set to `Joined`
|
||||
let members = if history_visibility == HistoryVisibility::Joined {
|
||||
joined.iter().chain(&[])
|
||||
} else {
|
||||
joined.iter().chain(&invited)
|
||||
};
|
||||
|
||||
let settings = settings.ok_or(MegolmError::EncryptionNotEnabled)?;
|
||||
let settings = EncryptionSettings::new(settings, history_visiblity);
|
||||
let settings = EncryptionSettings::new(settings, history_visibility);
|
||||
|
||||
Ok(o.share_group_session(room_id, members, settings).await?)
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ impl RoomState {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get the history visiblity policy of this room.
|
||||
pub fn history_visiblity(&self) -> HistoryVisibility {
|
||||
/// Get the history visibility policy of this room.
|
||||
pub fn history_visibility(&self) -> HistoryVisibility {
|
||||
match self {
|
||||
RoomState::Joined(r) => r.inner.history_visibility(),
|
||||
RoomState::Left(r) => r.inner.history_visibility(),
|
||||
|
@ -169,7 +169,7 @@ pub struct BaseRoomInfo {
|
|||
pub encryption: Option<EncryptionEventContent>,
|
||||
/// The guest access policy of this room.
|
||||
pub guest_access: GuestAccess,
|
||||
/// The history visiblity policy of this room.
|
||||
/// The history visibility policy of this room.
|
||||
pub history_visibility: HistoryVisibility,
|
||||
/// The join rule policy of this room.
|
||||
pub join_rule: JoinRule,
|
||||
|
|
|
@ -197,7 +197,7 @@ impl Room {
|
|||
self.inner.read().unwrap().base_info.guest_access.clone()
|
||||
}
|
||||
|
||||
/// Get the history visiblity policy of this room.
|
||||
/// Get the history visibility policy of this room.
|
||||
pub fn history_visibility(&self) -> HistoryVisibility {
|
||||
self.inner
|
||||
.read()
|
||||
|
|
|
@ -105,7 +105,7 @@ impl StrippedRoom {
|
|||
self.inner.lock().unwrap().base_info.encryption.clone()
|
||||
}
|
||||
|
||||
/// Get the history visiblity policy of this room.
|
||||
/// Get the history visibility policy of this room.
|
||||
pub fn history_visibility(&self) -> HistoryVisibility {
|
||||
self.inner
|
||||
.lock()
|
||||
|
|
|
@ -991,7 +991,7 @@ impl ReadOnlyAccount {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let visiblity = settings.history_visibility.clone();
|
||||
let visibility = settings.history_visibility.clone();
|
||||
|
||||
let outbound = OutboundGroupSession::new(
|
||||
self.device_id.clone(),
|
||||
|
@ -1009,7 +1009,7 @@ impl ReadOnlyAccount {
|
|||
signing_key,
|
||||
&room_id,
|
||||
outbound.session_key().await,
|
||||
Some(visiblity),
|
||||
Some(visibility),
|
||||
)
|
||||
.expect("Can't create inbound group session from a newly created outbound group session");
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ pub struct PickledInboundGroupSession {
|
|||
/// Flag remembering if the session was dirrectly sent to us by the sender
|
||||
/// or if it was imported.
|
||||
pub imported: bool,
|
||||
/// History visiblity of the room when the session was created.
|
||||
/// History visibility of the room when the session was created.
|
||||
pub history_visibility: Option<HistoryVisibility>,
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ impl Default for EncryptionSettings {
|
|||
|
||||
impl EncryptionSettings {
|
||||
/// Create new encryption settings using an `EncryptionEventContent` and a
|
||||
/// history visiblity.
|
||||
/// history visibility.
|
||||
pub fn new(content: EncryptionEventContent, history_visibility: HistoryVisibility) -> Self {
|
||||
let rotation_period: Duration = content
|
||||
.rotation_period_ms
|
||||
|
|
|
@ -242,7 +242,7 @@ impl GroupSessionManager {
|
|||
.collect::<HashSet<_>>()
|
||||
.is_empty();
|
||||
|
||||
let visiblity_changed = outbound.settings().history_visibility != history_visibility;
|
||||
let visibility_changed = outbound.settings().history_visibility != history_visibility;
|
||||
|
||||
// To protect the room history we need to rotate the session if either:
|
||||
//
|
||||
|
@ -251,7 +251,7 @@ impl GroupSessionManager {
|
|||
// 3. The history visibility changed.
|
||||
//
|
||||
// This is calculated in the following code and stored in this variable.
|
||||
let mut should_rotate = user_left || visiblity_changed;
|
||||
let mut should_rotate = user_left || visibility_changed;
|
||||
|
||||
for user_id in users {
|
||||
let user_devices = self.store.get_user_devices(&user_id).await?;
|
||||
|
|
Loading…
Reference in a new issue