Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.682
diff -u -p -r1.682 comment.module
--- modules/comment/comment.module	14 Jan 2009 21:48:24 -0000	1.682
+++ modules/comment/comment.module	14 Feb 2009 05:53:53 -0000
@@ -484,7 +484,7 @@ function comment_nodeapi_view($node, $te
         }
       }
     }
-    
+
     if (isset($links['comment_forbidden'])) {
       $links['comment_forbidden']['html'] = TRUE;
     }
@@ -493,7 +493,7 @@ function comment_nodeapi_view($node, $te
       '#type' => 'node_links',
       '#value' => $links,
     );
-    
+
     // Append the list of comments to $node->content for node detail pages.
     if ($node->comment && (bool)menu_get_object() && $node->build_mode != NODE_BUILD_PREVIEW) {
       $node->content['comments'] = array(
@@ -2091,7 +2091,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)'),
@@ -2099,18 +2099,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)) {
@@ -2129,6 +2137,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
@@ -2156,12 +2189,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) {
