You are here

public function ActivityActionHandler::isPublished in Activity 7

Return whether or not the Activity is published.

Parameters

array $objects: The objects used in tokenization.

int $actor: The uid of the actor for this activity.

2 calls to ActivityActionHandler::isPublished()
NodeActivityActionHandler::isPublished in ./activity_action_handlers.inc
Return whether or not the Activity is published.
UserActivityActionHandler::isPublished in ./activity_action_handlers.inc
Return whether or not the Activity is published.
2 methods override ActivityActionHandler::isPublished()
NodeActivityActionHandler::isPublished in ./activity_action_handlers.inc
Return whether or not the Activity is published.
UserActivityActionHandler::isPublished in ./activity_action_handlers.inc
Return whether or not the Activity is published.

File

./activity_action_handlers.inc, line 331

Class

ActivityActionHandler

Code

public function isPublished($objects, $actor) {

  // Key is to determine if the Actor is not blocked.
  if ($actor == 0) {

    // Anon user is blocked by default and cannot be unblocked. i.e their
    // status can never and will never change, always being 0. Thus, anon
    // gets a pass through.
    return TRUE;
  }
  $status = db_query("SELECT status FROM {users} WHERE uid = :uid", array(
    ":uid" => $actor,
  ))
    ->fetchField();
  return $status == 1;
}