You are here

function messaging_update_method_update in Messaging 7

Same name and namespace in other branches
  1. 6.4 messaging.install \messaging_update_method_update()
  2. 6 messaging.install \messaging_update_method_update()
  3. 6.2 messaging.install \messaging_update_method_update()
  4. 6.3 messaging.install \messaging_update_method_update()

Udate sending method, change for a new one

1 call to messaging_update_method_update()
messaging_update_method_disable in ./messaging.install
Disable a sending method and return an alternative one

File

./messaging.install, line 146

Code

function messaging_update_method_update($old, $new) {

  // Replace some variables
  if ($old == variable_get('messaging_default_method', NULL)) {
    if ($new) {
      variable_set('messaging_default_method', $new);
    }
    else {
      variable_del('messaging_default_method');
    }
  }

  // Inform all modules this method is being replaced
  module_invoke_all('messaging_method', 'replace', $old, $new);

  // Now inform all that old method is being disabled
  module_invoke_all('messaging_method', 'disable', $old);
}