matrix-sdk: (fix) correct the history visibility states that allow us to view events in are_events_visible
parent
0e84349d05
commit
b984fcca0c
|
@ -12,8 +12,10 @@ use ruma::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
error::{self, HttpError},
|
||||||
media::{MediaFormat, MediaRequest, MediaType},
|
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
|
/// A struct containing methods that are common for Joined, Invited and Left
|
||||||
|
@ -171,9 +173,7 @@ impl Common {
|
||||||
|
|
||||||
async fn ensure_members(&self) -> Result<()> {
|
async fn ensure_members(&self) -> Result<()> {
|
||||||
if !self.are_events_visible() {
|
if !self.are_events_visible() {
|
||||||
return Err(
|
return Err(error::Error::Http(HttpError::NotClientRequest));
|
||||||
error::Error::Http(HttpError::NotClientRequest)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.are_members_synced() {
|
if !self.are_members_synced() {
|
||||||
|
@ -186,11 +186,11 @@ impl Common {
|
||||||
fn are_events_visible(&self) -> bool {
|
fn are_events_visible(&self) -> bool {
|
||||||
if let RoomType::Invited = self.inner.room_type() {
|
if let RoomType::Invited = self.inner.room_type() {
|
||||||
return match self.inner.history_visibility() {
|
return match self.inner.history_visibility() {
|
||||||
HistoryVisibility::WorldReadable | HistoryVisibility::Shared => true,
|
HistoryVisibility::WorldReadable | HistoryVisibility::Invited => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue