You are here

function privatemsg_message_uri_callback in Privatemsg 7

Same name and namespace in other branches
  1. 7.2 privatemsg.module \privatemsg_message_uri_callback()

Returns the URI for a private message.

Parameters

$message: Private message object.

Return value

URI array as defined by hook_entity_info().

1 string reference to 'privatemsg_message_uri_callback'
privatemsg_entity_info in ./privatemsg.module
Implements hook_entity_info().

File

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

Code

function privatemsg_message_uri_callback($message) {
  $uri = array();
  if (isset($message->mid) && isset($message->thread_id)) {
    $uri = array(
      'path' => 'messages/view/' . $message->thread_id,
      'options' => array(),
    );

    // Add message fragment, if necessary.
    if ($message->mid != $message->thread_id) {
      $uri['options']['fragment'] = 'privatemsg-mid-' . $message->mid;
    }
  }
  return $uri;
}