def delete(mastodon, collection, status):
    """
    Delete toot, unfavour favourite, or dismiss notification and mark
    it as deleted. The "record not found" error is handled elsewhere.
    """
    if collection == 'statuses':
        if status['reblog']:
            mastodon.status_unreblog(status['id'])
        else:
            mastodon.status_delete(status['id'])
    elif collection == 'favourites':
        mastodon.status_unfavourite(status['id'])
    elif collection == 'mentions':
        mastodon.notifications_dismiss(status['id'])
    status['deleted'] = True
