You are here

function Messaging_Message::set_user in Messaging 7

Same name and namespace in other branches
  1. 6.4 includes/messaging_message.class.inc \Messaging_Message::set_user()
  2. 6.3 classes/messaging_message.class.inc \Messaging_Message::set_user()

Set user, if the message is intended for a single user try to find suitable method

File

./messaging.message.inc, line 219
Drupal Messaging Framework - Message class file

Class

Messaging_Message
Message class

Code

function set_user($account) {
  $this->uid = $account->uid;
  if (empty($this->method)) {
    $this->method = Messaging_Method::default_method($account);
  }
  return $this
    ->add_user($account);
}