Index: privatemsg_hook.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/Attic/privatemsg_hook.php,v
retrieving revision 1.1.4.2
diff -u -r1.1.4.2 privatemsg_hook.php
--- privatemsg_hook.php	20 Jul 2007 11:25:11 -0000	1.1.4.2
+++ privatemsg_hook.php	2 May 2008 23:33:01 -0000
@@ -25,3 +25,17 @@
  */
 function privatemsgapi_privatemsg($message, $op) {
 }
+
+/**
+ * Declare one or more private messages types.
+ *
+ * @return
+ *   Return array describing private messages types with
+ *   keys being machine readable names and values, human
+ *   readable ones.
+ */
+function hook_privatemsg_types() {
+  return array(
+    'my-type' => t('My type'),
+  );
+}
Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/Attic/privatemsg.module,v
retrieving revision 1.70.2.30.2.88
diff -u -r1.70.2.30.2.88 privatemsg.module
--- privatemsg.module	22 Jan 2008 06:49:22 -0000	1.70.2.30.2.88
+++ privatemsg.module	2 May 2008 23:33:01 -0000
@@ -459,6 +459,15 @@
   return TRUE;
 }
 
+/**
+ * Implementation of hook privatemsg_types().
+ */
+function privatemsg_privatemsg_types() {
+  return array(
+    'private-message' => t('Private message'),
+  );
+}
+
 function privatemsg_message_allowed($recipient, $author = NULL) {
   global $user;
 
@@ -806,9 +815,8 @@
   );
   $filter_types = array('all types' => t('All types'));
   while ($t = db_fetch_object($result)) {
-    $type = check_plain($t->type);
-    $types[$type] = $type;
-    $filter_types[$type] = $type;
+    $types[$t->type] = privatemsg_type($t->type);
+    $filter_types[$t->type] = privatemsg_type($t->type);
   }
   $form['header']['type'] = array(
     '#type' => 'select',
@@ -894,7 +902,7 @@
       '#type' => 'checkbox',
     );
     $form['messages'][$message->id]['type'] = array(
-      '#value' => check_plain($message->type),
+      '#value' => privatemsg_type($message->type),
     );
     $form['messages'][$message->id]['user'] = array(
       '#type' => 'value',
@@ -1665,6 +1673,24 @@
 }
 
 /**
+ * Get private messages types information.
+ *
+ * @param $type
+ *   Machine readable name.
+ * @return
+ *   If $type is set return the human redable name for this type if any,
+ *   or the $type itself otherwise. If $type is not set return an array
+ *   with all available types.
+ */
+function privatemsg_type($type = NULL) {
+  static $types;
+  if (!isset($types)) {
+  	$types = module_invoke_all('privatemsg_types');
+  }
+  return isset($type) ? (isset($types[$type]) ? $types[$type] : $type) : $types;
+}
+
+/**
  * Display a user's contacts list and let them write a PM to multiple contacts.
  */
 function privatemsg_contacts_form() {
