#1026514 by te-brian: Added hook to let other modules respond to operations.
authorSascha Grossenbacher
Mon, 17 Jan 2011 16:40:49 +0000 (16:40 +0000)
committerSascha Grossenbacher
Mon, 17 Jan 2011 16:40:49 +0000 (16:40 +0000)
privatemsg.api.php
privatemsg.module

index f402b6c..3b03c0f 100644 (file)
@@ -618,5 +618,24 @@ function hook_privatemsg_name_lookup_matches(&$matches, $string) {
 }
 
 /**
+ * Allows response to a successful operation.
+ *
+ * @param $operation
+ *   The operation that was executed.
+ * @param $threads
+ *   An array which contains the thread ids on which the operation
+ *   has been executed.
+ * @param $account
+ *   An user account object if an other user than the currrently logged in is
+ *   affected.
+ *
+ * @see privatemsg_operation_execute()
+ * @see hook_privatemsg_thread_operations()
+ */
+function hook_privatemsg_operation_executed($operation, $threads, $account = NULL) {
+
+}
+
+/**
  * @}
  */
index 1f5312d..b193b98 100644 (file)
@@ -2119,6 +2119,10 @@ function privatemsg_operation_execute($operation, $threads, $account = null) {
 
     drupal_set_message(t('The previous action can be <a href="!undo">undone</a>.', array('!undo' => $undo)));
   }
+
+  // Allow modules to respond to the operation.
+  module_invoke_all('privatemsg_operation_executed', $operation, $threads, $account);
+
   return TRUE;
 }