You are here

function messaging_method_default in Messaging 5

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

Returns default messaging method

4 calls to messaging_method_default()
Messaging_API_Tests::testMessagingBasicAPI in tests/messaging_api.test
Play with creating, retrieving, deleting a pair messages
messaging_message_send in ./messaging.module
Send message to array of destinations. The message is rendered just once.
messaging_message_send_user in ./messaging.module
Send message to user represented by account
messaging_user in ./messaging.module
Implementation of hook_user().

File

./messaging.module, line 631

Code

function messaging_method_default($account = NULL) {
  if ($account && $account->messaging_default && messaging_method_permission($account->messaging_default, $account)) {
    return $account->messaging_default;
  }
  elseif ($method = variable_get('messaging_default_method', '')) {
    return $method;
  }
  else {
    return key(messaging_method_info());
  }
}