'Get data from a room.
Args:
event : The room path event
Returns:
The path data content.
Raises:
SynapseError if something went wrong.'

@defer.inlineCallbacks
def get_room_data(self, user_id=None, room_id=None, event_type=None, state_key='', is_guest=False):

    (membership, membership_event_id) = (yield self._check_in_room_or_world_readable(room_id, user_id))
    if (membership == Membership.JOIN):
        data = (yield self.state_handler.get_current_state(room_id, event_type, state_key))
    elif (membership == Membership.LEAVE):
        key = (event_type, state_key)
        room_state = (yield self.store.get_state_for_events([membership_event_id], [key]))
        data = room_state[membership_event_id].get(key)
    defer.returnValue(data)
