def filter_messages_by_user(history, user):
    """Filter messages sent by the specified user in the provided history"""
    own_messages = []

    print('Filtering messages for user {}...'.format(user['username']))

    for message in history:
        if user['id'] == message['from']['id']:
            own_messages.insert(0, message)
            print('x', end='', flush=True)
        else:
            print('.', end='', flush=True)

    print('')

    return own_messages