Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.702
diff -u -p -r1.702 comment.module
--- modules/comment/comment.module	11 Apr 2009 22:19:44 -0000	1.702
+++ modules/comment/comment.module	19 Apr 2009 15:38:48 -0000
@@ -2140,7 +2140,7 @@ function comment_action_info() {
       'configurable' => FALSE,
       'hooks' => array(
         'comment' => array('insert', 'update'),
-      )
+      ),
     ),
     'comment_unpublish_by_keyword_action' => array(
       'description' => t('Unpublish comment containing keyword(s)'),
@@ -2148,18 +2148,26 @@ function comment_action_info() {
       'configurable' => TRUE,
       'hooks' => array(
         'comment' => array('insert', 'update'),
-      )
-    )
+      ),
+    ),
+    'comment_publish_action' => array(
+      'description' => t('Publish comment'),
+      'type' => 'comment',
+      'configurable' => FALSE,
+      'hooks' => array(
+        'comment' => array('insert', 'update'),
+      ),
+    ),
   );
 }
 
 /**
  * Drupal action to unpublish a comment.
  *
- * @param $context
- *   Keyed array. Must contain the id of the comment if $comment is not passed.
  * @param $comment
  *   An optional comment object.
+ * @param $context
+ *   Keyed array. Must contain the id of the comment if $comment is not passed.
  */
 function comment_unpublish_action($comment, $context = array()) {
   if (isset($comment->cid)) {
@@ -2178,6 +2186,31 @@ function comment_unpublish_action($comme
 }
 
 /**
+ * Drupal action to publish a comment.
+ *
+ * @param $comment
+ *   An optional comment object.
+ * @param $context
+ *   Keyed array. Must contain the id of the comment if $comment is not passed.
+ *
+ */
+function comment_publish_action($comment, $context = array()) {
+  if (isset($comment->cid)) {
+    $cid = $comment->cid;
+    $subject = $comment->subject;
+  }
+  else {
+    $cid = $context['cid'];
+    $subject = db_query('SELECT subject FROM {comment} WHERE cid = :cid', array(':cid', $cid))->fetchField();
+  }
+  db_update('comment')
+    ->fields(array('status' => COMMENT_PUBLISHED,))
+    ->condition('cid', $cid)
+    ->execute();
+  watchdog('action', 'Published comment %subject.', array('%subject' => $subject));
+}
+
+/**
  * Form builder; Prepare a form for blacklisted keywords.
  *
  * @ingroup forms
@@ -2205,12 +2238,12 @@ function comment_unpublish_by_keyword_ac
  *
  * Unpublish a comment if it contains a certain string.
  *
+ * @param $comment
+ *   A comment object.
  * @param $context
  *   An array providing more information about the context of the call to this action.
  *   Unused here, since this action currently only supports the insert and update ops of
  *   the comment hook, both of which provide a complete $comment object.
- * @param $comment
- *   A comment object.
  */
 function comment_unpublish_by_keyword_action($comment, $context) {
   foreach ($context['keywords'] as $keyword) {
