You are here

function notifications_autosubscribe_notifications in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_autosubscribe/notifications_autosubscribe.module \notifications_autosubscribe_notifications()

Implementation of hook_notifications.

File

notifications_autosubscribe/notifications_autosubscribe.module, line 67

Code

function notifications_autosubscribe_notifications($op, $arg0, $arg1 = NULL, $arg2 = NULL) {
  if ($op == 'event trigger') {
    $event = $arg0;
    if ($event->type == 'node' && isset($event->node->nid) && (!isset($event->node->autosubscribe) || $event->node->autosubscribe) && $event->action !== 'update') {
      notifications_autosubscribe('thread', 'node', 'nid', $event->node->nid);
    }
  }
}