You are here

function notifications_messaging in Notifications 6.3

Same name and namespace in other branches
  1. 5 notifications.module \notifications_messaging()
  2. 6.4 notifications.module \notifications_messaging()
  3. 6 notifications.module \notifications_messaging()
  4. 6.2 notifications.module \notifications_messaging()
  5. 7 notifications.module \notifications_messaging()

Implementation of hook_messaging()

Update subscriptions when a messaging method is updated.

File

./notifications.module, line 1087
Notifications module

Code

function notifications_messaging($op, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL) {
  switch ($op) {
    case 'method update':

      // A messaging method has been disabled ($arg1) and replaced by the new one ($arg2)
      // Update subscriptions
      db_query("UPDATE {notifications} SET send_method = '%s' WHERE send_method = '%s'", $arg2, $arg1);

      // Purge notifications queue, we may lost some notifications but it's the safest option.
      db_query("DELETE FROM {notifications_queue} WHERE send_method = '%s'", $arg1);
      break;
  }
}