'Populates the `joined` and `archived` section of `sync_result_builder`
based on the `room_builder`.
Args:
sync_result_builder(SyncResultBuilder)
ignored_users(set(str)): Set of users ignored by user.
room_builder(RoomSyncResultBuilder)
ephemeral(list): List of new ephemeral events for room
tags(list): List of *all* tags for room, or None if there has been
no change.
account_data(list): List of new account data for room
always_include(bool): Always include this room in the sync response,
even if empty.'

@defer.inlineCallbacks
def _generate_room_entry(self, sync_result_builder, ignored_users, room_builder, ephemeral, tags, account_data, always_include=False):

    newly_joined = room_builder.newly_joined
    full_state = (room_builder.full_state or newly_joined or sync_result_builder.full_state)
    events = room_builder.events
    if (not (always_include or account_data or ephemeral or full_state)):
        if ((events == []) and (tags is None)):
            return
    since_token = sync_result_builder.since_token
    now_token = sync_result_builder.now_token
    sync_config = sync_result_builder.sync_config
    room_id = room_builder.room_id
    since_token = room_builder.since_token
    upto_token = room_builder.upto_token
    batch = (yield self._load_filtered_recents(room_id, sync_config, now_token=upto_token, since_token=since_token, recents=events, newly_joined_room=newly_joined))
    account_data_events = []
    if (tags is not None):
        account_data_events.append({'type': 'm.tag', 'content': {'tags': tags}})
    for (account_data_type, content) in account_data.items():
        account_data_events.append({'type': account_data_type, 'content': content})
    account_data = sync_config.filter_collection.filter_room_account_data(account_data_events)
    ephemeral = sync_config.filter_collection.filter_room_ephemeral(ephemeral)
    if (not (always_include or batch or account_data or ephemeral or full_state)):
        return
    state = (yield self.compute_state_delta(room_id, batch, sync_config, since_token, now_token, full_state=full_state))
    if (room_builder.rtype == 'joined'):
        unread_notifications = {}
        room_sync = JoinedSyncResult(room_id=room_id, timeline=batch, state=state, ephemeral=ephemeral, account_data=account_data_events, unread_notifications=unread_notifications)
        if (room_sync or always_include):
            notifs = (yield self.unread_notifs_for_room_id(room_id, sync_config))
            if (notifs is not None):
                unread_notifications['notification_count'] = notifs['notify_count']
                unread_notifications['highlight_count'] = notifs['highlight_count']
            sync_result_builder.joined.append(room_sync)
    elif (room_builder.rtype == 'archived'):
        room_sync = ArchivedSyncResult(room_id=room_id, timeline=batch, state=state, account_data=account_data)
        if (room_sync or always_include):
            sync_result_builder.archived.append(room_sync)
    else:
        raise Exception('Unrecognized    rtype:    %r', room_builder.rtype)
