Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.693
diff -u -r1.693 comment.module
--- modules/comment/comment.module	18 Feb 2009 15:19:55 -0000	1.693
+++ modules/comment/comment.module	23 Feb 2009 14:06:53 -0000
@@ -136,13 +136,13 @@
       'arguments' => array('comment' => NULL, 'node' => NULL),
     ),
     'comment_flat_expanded' => array(
-      'arguments' => array('comment' => NULL, 'node' => NULL),
+      'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => NULL),
     ),
     'comment_thread_collapsed' => array(
       'arguments' => array('comment' => NULL, 'node' => NULL),
     ),
     'comment_thread_expanded' => array(
-      'arguments' => array('comment' => NULL, 'node' => NULL),
+      'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => NULL),
     ),
     'comment_post_forbidden' => array(
       'arguments' => array('nid' => NULL),
@@ -1129,17 +1129,20 @@
           }
         }
 
+        $links = module_invoke_all('link', 'comment', $comment, 1);
+        drupal_alter('link', $links, $node);
+
         if ($mode == COMMENT_MODE_FLAT_COLLAPSED) {
           $comments .= theme('comment_flat_collapsed', $comment, $node);
         }
         elseif ($mode == COMMENT_MODE_FLAT_EXPANDED) {
-          $comments .= theme('comment_flat_expanded', $comment, $node);
+          $comments .= theme('comment_flat_expanded', $comment, $node, $links);
         }
         elseif ($mode == COMMENT_MODE_THREADED_COLLAPSED) {
           $comments .= theme('comment_thread_collapsed', $comment, $node);
         }
         elseif ($mode == COMMENT_MODE_THREADED_EXPANDED) {
-          $comments .= theme('comment_thread_expanded', $comment, $node);
+          $comments .= theme('comment_thread_expanded', $comment, $node, $links);
         }
         $num_rows = TRUE;
       }
@@ -1826,8 +1829,8 @@
  *   The comment node.
  * @ingroup themeable
  */
-function theme_comment_flat_expanded($comment, $node) {
-  return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0));
+function theme_comment_flat_expanded($comment, $node, $links) {
+  return theme('comment_view', $comment, $node, $links);
 }
 
 /**
@@ -1852,8 +1855,8 @@
  *   The comment node.
  * @ingroup themeable
  */
-function theme_comment_thread_expanded($comment, $node) {
-  return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0));
+function theme_comment_thread_expanded($comment, $node, $links) {
+  return theme('comment_view', $comment, $node, $links);
 }
 
 /**

