Index: talk.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/talk/talk.module,v
retrieving revision 1.1.2.1.2.1.2.1
diff -u -p -u -p -r1.1.2.1.2.1.2.1 talk.module
--- talk.module	17 Sep 2008 16:07:26 -0000	1.1.2.1.2.1.2.1
+++ talk.module	3 Mar 2009 01:25:37 -0000
@@ -192,3 +192,89 @@ function theme_talkpage($node, $add_comm
   }
   return $output;
 }
+
+/**
+ * Implementation of hook_token_list(). Documents the individual
+ * tokens handled by the module.
+ */
+function talk_token_list($type = 'all') {
+  $tokens = array();
+  if ($type == 'comment' || $type == 'all') {  
+    $tokens['comment']['comment-url-talk'] = t('The comment view url (Talk).');
+  }
+  return $tokens;
+}
+
+/**
+ * Implementation of hook_token_values()
+ */
+function talk_token_values($type, $object = NULL, $options = array()) {
+  switch ($type) {
+    case 'comment':
+      if ($comment = (object)$object) {
+        $talk = '';
+        $node = node_load($comment->nid);
+        if (talk_activated($node->type)) {
+          $talk = '/talk';
+        }
+        $values['comment-url-talk'] = url('node/'. $comment->nid . $talk, NULL, 'comment-'. $comment->cid, TRUE);
+        return $values;
+      }
+      break;
+  }
+}
