You are here

protected function HeartbeatAccess::checkDeniedMessages in Heartbeat 6.4

Check denied messages

2 calls to HeartbeatAccess::checkDeniedMessages()
GroupsActivity::prepareStream in modules/og_activity/groupsactivity.inc
Override of the prepareStream function
HeartbeatAccess::prepareStream in includes/heartbeataccess.inc
prepareStream

File

includes/heartbeataccess.inc, line 355
HeartbeatAccess object is the object that takes stream configuration to create a stream of activity objects. It is the controlling organ at the pre-query, query and post-query phases.

Class

HeartbeatAccess
Abstract class heartbeataccess This base class has final template methods which are used by the derived concretes. The HeartbeatAccess is a state object that is given to the HeartbeatMessageBuilder to set the access to the current request.

Code

protected function checkDeniedMessages() {

  // Messages that have been denied through stream configuration
  // or overriden by user profile can be taken out in the query.
  // Note that for private and connected restrictions, it can only
  // be done later after the query.
  $denied_messages = array();
  if (!empty($this->stream->messages_denied)) {
    $denied_messages += array_keys($this->stream->messages_denied);
  }
  $denied_messages = array_unique($denied_messages);
  if (!empty($denied_messages)) {
    $this->stream->sql_start .= " AND ua.message_id NOT IN ('" . implode("','", $denied_messages) . "') ";
  }
}