synapse/storage/user_directory.py
def is_room_world_readable_or_publicly_joinable(self, room_id, cache_context):
        """Check if the room is either world_readable or publically joinable
        """
        current_state_ids = yield self.get_current_state_ids(
            room_id, on_invalidate=cache_context.invalidate
        )

        join_rules_id = current_state_ids.get((EventTypes.JoinRules, ""))
        if join_rules_id:
            join_rule_ev = yield self.get_event(join_rules_id, allow_none=True)
            if join_rule_ev:
                if join_rule_ev.content.get("join_rule") == JoinRules.PUBLIC:
                    defer.returnValue(True)

        hist_vis_id = current_state_ids.get((EventTypes.RoomHistoryVisibility, ""))
        if hist_vis_id:
            hist_vis_ev = yield self.get_event(hist_vis_id, allow_none=True)
            if hist_vis_ev:
                if hist_vis_ev.content.get("history_visibility") == "world_readable":
                    defer.returnValue(True)

        defer.returnValue(False)
Check if the room is either world_readable or publically joinable
        
Check if the room is either world_readable or publically joinable
Check if the room is either world_readable or publically joinable
def is_room_world_readable_or_publicly_joinable(self, room_id, cache_context):
        current_state_ids = yield self.get_current_state_ids(
            room_id, on_invalidate=cache_context.invalidate
        )
        join_rules_id = current_state_ids.get((EventTypes.JoinRules, ""))
        if join_rules_id:
            join_rule_ev = yield self.get_event(join_rules_id, allow_none=True)
            if join_rule_ev:
                if join_rule_ev.content.get("join_rule") == JoinRules.PUBLIC:
                    defer.returnValue(True)
        hist_vis_id = current_state_ids.get((EventTypes.RoomHistoryVisibility, ""))
        if hist_vis_id:
            hist_vis_ev = yield self.get_event(hist_vis_id, allow_none=True)
            if hist_vis_ev:
                if hist_vis_ev.content.get("history_visibility") == "world_readable":
                    defer.returnValue(True)
        defer.returnValue(False)
def is_room_world_readable_or_publicly_joinable ( self , room_id , cache_context ) : current_state_ids = yield self . get_current_state_ids ( room_id , on_invalidate = cache_context . invalidate ) join_rules_id = current_state_ids . get ( ( EventTypes . JoinRules , "" ) ) if join_rules_id : join_rule_ev = yield self . get_event ( join_rules_id , allow_none = True ) if join_rule_ev : if join_rule_ev . content . get ( "join_rule" ) == JoinRules . PUBLIC : defer . returnValue ( True ) hist_vis_id = current_state_ids . get ( ( EventTypes . RoomHistoryVisibility , "" ) ) if hist_vis_id : hist_vis_ev = yield self . get_event ( hist_vis_id , allow_none = True ) if hist_vis_ev : if hist_vis_ev . content . get ( "history_visibility" ) == "world_readable" : defer . returnValue ( True ) defer . returnValue ( False )
Check if the room is either world_readable or publically joinable
Check if the room is either world_readable or publically joinable
"""Check if the room is either world_readable or publically joinable
        """
self
room_id
cache_context