'Report a link, comment or message.
Reporting a thing brings it to the attention of the subreddit\'s
moderators. Reporting a message sends it to a system for admin review.
For links and comments, the thing is implicitly hidden as well (see
[/api/hide](#POST_api_hide) for details).'

@require_oauth2_scope('report')
@validatedForm(VUser(), VModhash(), thing=VByName('thing_id'), reason=VLength('reason', max_length=100, empty_error=None), site_reason=VLength('site_reason', max_length=100, empty_error=None), other_reason=VLength('other_reason', max_length=100, empty_error=None))
@api_doc(api_section.links_and_comments)
def POST_report(self, form, jquery, thing, reason, site_reason, other_reason):

    if (not thing):
        thing_id = request.POST.get('id')
        if thing_id:
            thing = VByName('id').run(thing_id)
    if ((not thing) or thing._deleted):
        return
    if (form.has_errors('reason', errors.TOO_LONG) or form.has_errors('site_reason', errors.TOO_LONG) or form.has_errors('other_reason', errors.TOO_LONG)):
        return
    sr = getattr(thing, 'subreddit_slow', None)
    if (reason == 'site_reason_selected'):
        reason = site_reason
    elif (reason == 'other'):
        reason = other_reason
    if isinstance(thing, Message):
        if ((c.user._id != thing.to_id) and (not (sr and (c.user._id in sr.moderator_ids())))):
            abort(403)
        admintools.spam(thing, False, True, c.user.name)
    elif isinstance(thing, Link):
        if (not (c.user_is_admin or sr.is_moderator(c.user))):
            thing._hide(c.user)
    elif isinstance(thing, Comment):
        pass
    VNotInTimeout().run(action_name='report', target=thing)
    hooks.get_hook('thing.report').call(thing=thing)
    if (not (c.user._spam or c.user.ignorereports or (sr and sr.is_banned(c.user)))):
        Report.new(c.user, thing, reason)
        admintools.report(thing)
    g.events.report_event(reason=reason, details_text=reason, subreddit=sr, target=thing, request=request, context=c)
    if isinstance(thing, (Link, Message)):
        button = jquery(('.id-%s    .report-button' % thing._fullname))
    elif isinstance(thing, Comment):
        button = jquery(('.id-%s    .entry:first    .report-button' % thing._fullname))
    else:
        return
    button.text(_('reported'))
    parent_div = jquery(('.report-%s.reportform' % thing._fullname))
    parent_div.removeClass('active')
    parent_div.html('')
