You are here

function instagram_feeds_moderation_flag in Instagram Feeds 7

Implements hook_flag().

Publish or unpublish node if user flags / unflags image as inappropriate.

File

modules/instagram_feeds_moderation/instagram_feeds_moderation.module, line 534

Code

function instagram_feeds_moderation_flag($op, $flag, $content_id, $account, $fcid) {
  if ('image_archived' == $flag->name && 'flag' == $op) {
    $inappropriate = flag_load('flag_as_inappropriate');
    if ($inappropriate && $inappropriate
      ->is_flagged($content_id)) {
      $inappropriate
        ->flag('unflag', $content_id, $account, TRUE);
    }
  }
}