matrix-sdk: (fix) correct the history visibility states that allow us to view events in are_events_visible

master
SaurusXI 2021-06-21 18:06:55 +05:30
parent 0e84349d05
commit b984fcca0c
No known key found for this signature in database
GPG Key ID: 443CCBEAA2C0E87E
1 changed files with 7 additions and 7 deletions

View File

@ -12,8 +12,10 @@ use ruma::{
};
use crate::{
error::{self, HttpError},
media::{MediaFormat, MediaRequest, MediaType},
BaseRoom, Client, Result, RoomMember, room::RoomType, error::{self, HttpError}
room::RoomType,
BaseRoom, Client, Result, RoomMember,
};
/// A struct containing methods that are common for Joined, Invited and Left
@ -171,9 +173,7 @@ impl Common {
async fn ensure_members(&self) -> Result<()> {
if !self.are_events_visible() {
return Err(
error::Error::Http(HttpError::NotClientRequest)
)
return Err(error::Error::Http(HttpError::NotClientRequest));
}
if !self.are_members_synced() {
@ -186,9 +186,9 @@ impl Common {
fn are_events_visible(&self) -> bool {
if let RoomType::Invited = self.inner.room_type() {
return match self.inner.history_visibility() {
HistoryVisibility::WorldReadable | HistoryVisibility::Shared => true,
HistoryVisibility::WorldReadable | HistoryVisibility::Invited => true,
_ => false,
}
};
}
true