'Distinguish a thing\'s author with a sigil.
This can be useful to draw attention to and confirm the identity of the
user in the context of a link or comment of theirs. The options for
distinguish are as follows:
* `yes` - add a moderator distinguish (`[M]`). only if the user is a
moderator of the subreddit the thing is in.
* `no` - remove any distinguishes.
* `admin` - add an admin distinguish (`[A]`). admin accounts only.
* `special` - add a user-specific distinguish. depends on user.
The first time a top-level comment is moderator distinguished, the
author of the link the comment is in reply to will get a notification
in their inbox.'

@require_oauth2_scope('modposts')
@validatedForm(VUser(), VModhash(), VCanDistinguish(('id', 'how')), thing=VByName('id'), how=VOneOf('how', ('yes', 'no', 'admin', 'special')))
@api_doc(api_section.moderation)
def POST_distinguish(self, form, jquery, thing, how):

    if (not thing):
        return
    sticky = False
    if feature.is_enabled('sticky_comments'):
        sticky_validator = VBoolean('sticky', default=False)
        sticky = sticky_validator.run(request.params.get('sticky'))
    if (feature.is_enabled('sticky_comments') and sticky and (not isinstance(thing, Comment))):
        abort(400, 'Only    comments    may    be    stickied    from    distinguish.    To    sticky    a    link    in    a    subreddit    use    set_subreddit_sticky.')
    c.profilepage = (request.params.get('profilepage') == 'True')
    log_modaction = True
    log_kw = {}
    send_message = False
    original = getattr(thing, 'distinguished', 'no')
    if (how == original):
        log_modaction = False
    elif (how in ('admin', 'special')):
        log_modaction = False
        send_message = True
    elif ((original in ('admin', 'special')) and (how == 'no')):
        log_modaction = False
    elif (how == 'no'):
        log_kw['details'] = 'remove'
    else:
        send_message = True
    if isinstance(thing, Comment):
        link = thing.link_slow
        if (not thing.parent_id):
            to = Account._byID(link.author_id, data=True)
            replies_enabled = link.sendreplies
        else:
            parent = Comment._byID(thing.parent_id, data=True)
            to = Account._byID(parent.author_id, data=True)
            replies_enabled = parent.sendreplies
        previously_distinguished = hasattr(thing, 'distinguished')
        user_can_notify = ((not c.user._spam) and (c.user._id not in to.enemies) and (to.name != c.user.name))
        if (send_message and (not replies_enabled) and (not previously_distinguished) and user_can_notify):
            inbox_rel = Inbox._add(to, thing, 'selfreply')
            queries.update_comment_notifications(thing, inbox_rel)
        if feature.is_enabled('sticky_comments'):
            try:
                if ((not sticky) or (how == 'no')):
                    if (link.sticky_comment_id == thing._id):
                        link.remove_sticky_comment(set_by=c.user)
                elif (sticky and (how != 'no')):
                    link.set_sticky_comment(thing, set_by=c.user)
            except RedditError as error:
                abort_with_error(error, (error.code or 400))
    thing.distinguished = how
    thing._commit()
    hooks.get_hook('thing.distinguish').call(thing=thing)
    wrapper = default_thing_wrapper(expand_children=True)
    w = wrap_links(thing, wrapper)
    jquery('body>div.content').replace_things(w, True, True)
    jquery('body>div.content    .link    .rank').hide()
    if log_modaction:
        sr = thing.subreddit_slow
        ModAction.create(sr, c.user, 'distinguish', target=thing, **log_kw)
