You are here

function og_notifications_user in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_notifications/og_notifications.module \og_notifications_user()
  2. 5.3 og_notifications/og_notifications.module \og_notifications_user()
  3. 6.2 modules/og_notifications/og_notifications.module \og_notifications_user()

Implementation of hook_user(). Handle uid entry in the og_notifications table.

File

modules/og_notifications/og_notifications.module, line 59
Provide notifications and messaging support for organic groups.

Code

function og_notifications_user($type, &$edit, &$user, $category = NULL) {
  switch ($type) {
    case 'insert':
      db_query("INSERT INTO {og_notifications} (uid) VALUES (%d)", $user->uid);
      break;
    case 'update':
      if (isset($edit['og_notifications_autosubscribe'])) {
        og_notifications_user_autosubscribe_set($user->uid, $edit['og_notifications_autosubscribe']);
        unset($edit['og_notifications_autosubscribe']);
      }
      break;
    case 'delete':
      db_query("DELETE FROM {og_notifications} WHERE uid = %d", $user->uid);
      break;
  }
}