function og_notifications_user_unsubscribe in Organic groups 6.2
Same name and namespace in other branches
- 5.8 og_notifications/og_notifications.module \og_notifications_user_unsubscribe()
- 5 og_notifications/og_notifications.module \og_notifications_user_unsubscribe()
- 5.3 og_notifications/og_notifications.module \og_notifications_user_unsubscribe()
- 5.7 og_notifications/og_notifications.module \og_notifications_user_unsubscribe()
- 6 modules/og_notifications/og_notifications.module \og_notifications_user_unsubscribe()
Unsubscribe a user from a group. This also unsubscribes the user from any grouptype subscriptions within the group.
Parameters
Object $account: The user account object.
Integer $gid: The node ID of the group being subscribed to.
2 calls to og_notifications_user_unsubscribe()
- og_notifications_og in modules/og_notifications/ og_notifications.module 
- Implementation of hook_og().
- og_notifications_user_subscribe in modules/og_notifications/ og_notifications.module 
- Subscribe a user to a group or to be more precise, to all subscribe-able content types within the group. This method is also called during the upgrade process in .install.
File
- modules/og_notifications/ og_notifications.module, line 504 
- Provide notifications and messaging support for organic groups.
Code
function og_notifications_user_unsubscribe($account, $gid) {
  notifications_delete_subscriptions(array(
    'uid' => $account->uid,
    'type' => 'grouptype',
  ), array(
    'group' => $gid,
  ));
}