? overlay_subtabs_invisible.png ? privatemsg_rules ? privatemsg_rules.tar.gz Index: privatemsg.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/privatemsg.module,v retrieving revision 1.70.2.30.2.91.2.64.2.86 diff -u -p -r1.70.2.30.2.91.2.64.2.86 privatemsg.module --- privatemsg.module 9 Sep 2010 08:27:59 -0000 1.70.2.30.2.91.2.64.2.86 +++ privatemsg.module 12 Sep 2010 15:58:36 -0000 @@ -2757,4 +2757,57 @@ function privatemsg_token_replace($text, // If the user is a recipient, use default token_replace() function. return token_replace($text, $data, $options); +} + +/** + * Implements hook_entity_property_info(). + */ +function privatemsg_entity_property_info() { + $info = array(); + // Add meta-data about the basic node properties. + $properties = &$info['privatemsg_message']['properties']; + $properties = array( + 'mid' => array( + 'type' => 'integer', + 'label' => t('Private message ID'), + 'description' => t('Private message ID'), + ), + // _ is automatically replaced by -. + 'thread-id' => array( + 'type' => 'integer', + 'label' => t('Private message thread ID'), + 'description' => t('Private message thread ID'), + 'getter callback' => 'privatemsg_thread_get_id', + ), + 'author' => array( + 'type' => 'user', + 'label' => t('Private message author'), + 'description' => t('Private message author'), + ), + 'subject' => array( + 'type' => 'text', + 'label' => t('Private message subject'), + 'description' => t('Private message subject'), + ), + 'body' => array( + 'type' => 'text', + 'label' => t('Private message body'), + 'description' => t('Private message body'), + ), + 'timestamp' => array( + 'type' => 'date', + 'label' => t('Private message sent date'), + 'description' => t('Private message sent date'), + ), + ); + return $info; +} + +/** + * Returns the thread ID of the passed in message. + * + * Function is requried because properties with _ can not be directly defined. + */ +function privatemsg_thread_get_id($privatemsg_message) { + return $privatemsg_message->thread_id; } \ No newline at end of file