You are here

static function Messaging_Method::default_method in Messaging 7

Returns default messaging method

1 call to Messaging_Method::default_method()
Messaging_Message::set_user in ./messaging.message.inc
Set user, if the message is intended for a single user try to find suitable method

File

./messaging.method.inc, line 71
Drupal Messaging Framework - Send_Method class file

Class

Messaging_Method
Base class for all Incoming and Sending methods

Code

static function default_method($account = NULL) {
  if ($account && !empty($account->messaging_default) && messaging_method($account->messaging_default)
    ->user_access($account)) {
    return $account->messaging_default;
  }
  elseif ($method = variable_get('messaging_default_method', '')) {
    return $method;
  }
  else {
    return key(messaging_method_info());
  }
}