function messaging_user_destination in Messaging 6
Same name and namespace in other branches
- 6.4 messaging.module \messaging_user_destination()
- 6.2 messaging.module \messaging_user_destination()
- 6.3 messaging.module \messaging_user_destination()
- 7 messaging.module \messaging_user_destination()
Get destination from user account
4 calls to messaging_user_destination()
- messaging_message_send_user in ./messaging.module 
- Send message to user represented by account
- Messaging_Methods_Tests::testMessagingMethods in tests/messaging_methods.test 
- Test message sending callbacks for enabled plug-ins
- messaging_method_list in ./messaging.module 
- List sending methods
- messaging_store_unpack in ./messaging.store.inc 
- Unpack stored messages
File
- ./messaging.module, line 195 
Code
function messaging_user_destination($account, $method, $message = NULL) {
  if ($info = messaging_method_info($method)) {
    if ($callback = _messaging_callback_get($info, 'destination')) {
      // We have a mapping function
      return _messaging_callback_invoke($callback, $account, $method, $message);
    }
    elseif ($property = messaging_method_info($method, 'destination')) {
      // Get destination property from user account
      return !empty($account->{$property}) ? $account->{$property} : NULL;
    }
  }
}