Index: notifications_mail2web.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notifications/notifications_mail2web/Attic/notifications_mail2web.module,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 notifications_mail2web.module
--- notifications_mail2web.module	30 Apr 2008 13:47:16 -0000	1.1.2.2
+++ notifications_mail2web.module	6 May 2008 18:00:05 -0000
@@ -174,6 +174,19 @@ function notifications_mail2web_mailhand
       $node->nid = $params['nid'];
       $node->pid = $params['cid'];
       
+      $title = mail2web_get_subject($node->nid);
+      // Check if the user set a custom subject.  If so, use it.
+      // If not, then strip the notifications text.
+      // if there is a pid (parent comment), then use the parent comments title + RE:
+      if (strpos($node->title, $title) !== FALSE) {
+        if ($node->pid == 0) {
+          $node->title = t('RE: '.mail2web_get_subject($node->nid));
+        }
+        elseif ($node->pid > 0) {
+          $node->title = t('RE: '.mail2web_get_pid_subject($node->pid));
+        }
+      }
+      
       // Now trim out the resf of the message if separator text exists
       // @ TODO May fail for html mails
       if ($marker = variable_get('mail2web_reply_text', t('((( Reply ABOVE this LINE to POST a COMMENT )))'))) {
@@ -357,3 +370,25 @@ function notifications_mail2web_signatur
   return md5(implode('-', $params));
 }
 
+/**
+ * Get title of node
+ *
+ * @param $nid
+ *
+ * @return node title
+ */
+function mail2web_get_subject($nid) {
+  return db_result(db_query("SELECT title FROM {node} WHERE nid = %d", $nid));
+}
+
+/**
+ * Get subject of parent comment.
+ *
+ * @param $pid
+ *   parent id of comment.
+ * @return comment subject
+ */
+
+function mail2web_get_pid_subject($pid) {
+  return db_result(db_query("SELECT subject FROM {comments} WHERE cid = %d", $pid));
+}
\ No newline at end of file
