From b984fcca0c8969917405f2d742f2356ba6540b72 Mon Sep 17 00:00:00 2001 From: SaurusXI Date: Mon, 21 Jun 2021 18:06:55 +0530 Subject: [PATCH] matrix-sdk: (fix) correct the history visibility states that allow us to view events in are_events_visible --- matrix_sdk/src/room/common.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/matrix_sdk/src/room/common.rs b/matrix_sdk/src/room/common.rs index 4da317f4..02c8583b 100644 --- a/matrix_sdk/src/room/common.rs +++ b/matrix_sdk/src/room/common.rs @@ -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,11 +186,11 @@ 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 }