? p.patch
Index: nodecomment.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodecomment/nodecomment.module,v
retrieving revision 1.3.2.15.2.17.2.59
diff -u -p -r1.3.2.15.2.17.2.59 nodecomment.module
--- nodecomment.module	19 Jul 2010 14:23:03 -0000	1.3.2.15.2.17.2.59
+++ nodecomment.module	1 Dec 2010 19:59:37 -0000
@@ -697,7 +697,11 @@ function nodecomment_save($node) {
   db_query("UPDATE {node_comments} SET nid = %d, pid = %d, thread = '%s', name = '%s', uid = %d, mail = '%s', homepage = '%s' WHERE cid = %d", $node->comment_target_nid, $node->comment_target_cid, $node->thread, $node->name, $node->uid, $node->mail, $node->homepage, $node->nid);
   // If not updated, insert a new comment.
   if (db_affected_rows() == 0) {
-    db_query("INSERT INTO {node_comments} (cid, nid, pid, hostname, thread, name, uid, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', '%s', %d, '%s', '%s')", $node->nid, $node->comment_target_nid, $node->comment_target_cid, ip_address(), $node->thread, $node->name, $node->uid, $node->mail, $node->homepage);
+    $result = db_result(db_query('SELECT COUNT(nid) FROM {node_comments} WHERE cid = %d', $node->nid));
+
+    if (!$result) {
+      db_query("INSERT INTO {node_comments} (cid, nid, pid, hostname, thread, name, uid, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', '%s', %d, '%s', '%s')", $node->nid, $node->comment_target_nid, $node->comment_target_cid, ip_address(), $node->thread, $node->name, $node->uid, $node->mail, $node->homepage);
+    }
   }
 
   _nodecomment_update_node_statistics($node->comment_target_nid);
