You are here

function heartbeat_plugins_heartbeat_stream_load in Heartbeat 7

Implements hook_heartbeat_stream_load().

TODO Refactor this for two reasons. First is the plugins should be attached to the stream if needed (cfr heartbeatActivity) Second is that the plugin loaded here loads too often and it is invisible to any other point in the process where we could have picked in.

File

modules/heartbeat_plugins/heartbeat_plugins.module, line 322

Code

function heartbeat_plugins_heartbeat_stream_load(HeartbeatStream $heartbeatStream) {

  // Always invoke the streamLoaded on every plugin.
  foreach (heartbeat_plugins_get_active_plugins() as $pluginWrapper) {
    $plugin = $pluginWrapper
      ->getPlugin();

    // Notify the plugin that there is a stream loaded.
    if ($plugin) {
      $plugin
        ->streamLoaded($heartbeatStream);

      // This is the method that will stay, replacing the one above.

      //$heartbeatStream->executePlugin($plugin);
    }
  }
}