You are here

function privatemsg_recipient_key in Privatemsg 7.2

Same name and namespace in other branches
  1. 6.2 privatemsg.module \privatemsg_recipient_key()
  2. 7 privatemsg.module \privatemsg_recipient_key()

Return key for a recipient object used for arrays.

Parameters

$recipient: Recipient object, must have type and recipient properties.

Return value

A string that looks like type_id.

Related topics

2 calls to privatemsg_recipient_key()
pm_block_user_privatemsg_block_message in pm_block_user/pm_block_user.module
Implements hook_privatemsg_block_message.
privatemsg_limits_privatemsg_block_message in privatemsg_limits/privatemsg_limits.module
Implements hook_privatemsg_block_message().

File

./privatemsg.module, line 2550
Allows users to send private messages to other users.

Code

function privatemsg_recipient_key($recipient) {
  if (empty($recipient->type)) {
    return 'user_' . $recipient->uid;
  }
  return $recipient->type . '_' . $recipient->recipient;
}