Index: listhandler.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/listhandler/listhandler.module,v
retrieving revision 1.56
diff -u -F^f -r1.56 listhandler.module
--- listhandler.module	17 Dec 2004 21:51:21 -0000	1.56
+++ listhandler.module	20 Jan 2005 18:37:13 -0000
@@ -6,15 +6,14 @@ function listhandler_help($section) {
   switch($section) {
     case 'admin/modules#description':
       $output = t('Connect your mailing lists to your drupal site and your drupal site to your mailing lists.');
-      $output .= ' $Id: listhandler.module,v 1.56 2004/12/17 21:51:21 killes Exp $';
       break;
   }
   return $output;
 }  
 
 /**
-* Permissions for this module.
-*/
+ * Permissions for this module.
+ */
 function listhandler_perm() {
   return array('administer listhandler');
 }
@@ -23,7 +22,6 @@ function listhandler_perm() {
 * Configuration options for this module
 */
 function listhandler_settings() {
-
   $output .= form_textfield(t('Admin address'), 'listhandler_from', variable_get('listhandler_from', ''), 50, 100, t('The email address of the list administrator. Used as From: address of messages sent by anonymous users.'));
   $output .= form_select(t('Account status'), 'listhandler_accountstatus', variable_get('listhandler_accountstatus', 0), array(0 => t('blocked'), 1 => t('active')), t('The status of accounts created by listhandler.'));
 
@@ -57,24 +55,23 @@ function listhandler_nodeapi(&$node, $op
 }
 
 /**
-* Called by comment.module after submitting a comment.
-* Sends comments to specified addresses.
-*
-* $type: type of call, here insert is expected.
-*
-* $edit: Array containing the comment.
-* Important fields:
-* $edit["subject"]: Oh well.
-* $edit["comment"]: The text
-* $edit["nid"]: commented node id
-* $edit["cid"]: comment id
-* $edit["pid"]: cid of parent
-* $edit["uid"]: user id
-* $edit["mid"]: id of mailbox
-* $edit["tid"]: taxo id of the forum
-*/
+ * Called by comment.module after submitting a comment.
+ * Sends comments to specified addresses.
+ *
+ * $type: type of call, here insert is expected.
+ *
+ * $edit: Array containing the comment.
+ * Important fields:
+ * $edit["subject"]: Oh well.
+ * $edit["comment"]: The text
+ * $edit["nid"]: commented node id
+ * $edit["cid"]: comment id
+ * $edit["pid"]: cid of parent
+ * $edit["uid"]: user id
+ * $edit["mid"]: id of mailbox
+ * $edit["tid"]: taxo id of the forum
+ */
 function listhandler_comment($type, $edit = array()) {
-
   if($type == "insert") { // only accept calls by the comment insert hook.
     if($edit["sentbylisthandler"]) { // avoid running an infinite loop.
       // save comment ids in listhandler table.
@@ -99,16 +96,14 @@ function listhandler_send_mail($edit) {
     $edit["name"] = $user->name;
     $edit["mail"] = $user->mail;
   }
-  /*
-   **  Find the list to send to.
-   */
+  // Find the list to send to.
   $mboxen = array();
 
   // taxo terms of the node.
   if (count($edit['taxonomy'])) {
     foreach ($edit['taxonomy'] as $taxoterm) {
       // Now for the mailbox.
-      $result2 = db_query("SELECT * FROM {mailhandler} m WHERE m.commands REGEXP '%s'", 'tid:[[:blank:]]*'. $taxoterm .'[^[:digit:]]*');
+      $result2 = db_query("SELECT * FROM {mailhandler} m WHERE m.commands REGEXP '%s'", 'tid:[[:blank:]]*'. $taxoterm .'[[:>:]]');
       while ($mbox = db_fetch_object($result2)) {
         $mboxen[] = array($mbox->mid, $mbox->mailto, $taxoarr->tid);
       }
@@ -118,7 +113,7 @@ function listhandler_send_mail($edit) {
     $result = db_query("SELECT t.tid FROM {term_node} t WHERE t.nid = %d", $edit["nid"]);
     while ($taxoarr = db_fetch_object($result)) {
       // Now for the mailbox.
-      $result2 = db_query("SELECT * FROM {mailhandler} m WHERE m.commands REGEXP '%s'", 'tid:[[:blank:]]*'. $taxoarr->tid .'[^[:digit:]]*');
+      $result2 = db_query("SELECT * FROM {mailhandler} m WHERE m.commands REGEXP '%s'", 'tid:[[:blank:]]*'. $taxoarr->tid .'[[:>:]]');
       while ($mbox = db_fetch_object($result2)) {
         $mboxen[] = array($mbox->mid, $mbox->mailto, $taxoarr->tid);
       }
@@ -156,20 +151,20 @@ function listhandler_send_mail($edit) {
 }
 
 /**
-* Called by mailhandler after a new node has been received.
-*
-* Only the first and last argument are used.
-*
-* $node: The new node or comment
-* $stream: The number of the opened imap stream.
-* $msg_number: The number of the current message in the mailbox.
-* $mailbox: Array containing info about the mailbox the message is from.
-* $header: Some, but not all headers (From, To, message_id, ...) of the current message. 
-*/
+ * Called by mailhandler after a new node has been received.
+ *
+ * Only the first and last argument are used.
+ *
+ * $node: The new node or comment
+ * $stream: The number of the opened imap stream.
+ * $msg_number: The number of the current message in the mailbox.
+ * $mailbox: Array containing info about the mailbox the message is from.
+ * $header: Some, but not all headers (From, To, message_id, ...) of the current message. 
+ */
 function listhandler_mailhandler($node, $result, $msg_number, $header, $mailbox){
   global $base_url;
 
-  if($node->tid){ // If no tid is assigned, then the mail is not comming through a mailhandler enabled list. Do nothing.
+  if($node->tid) { // If no tid is assigned, then the mail is not comming through a mailhandler enabled list. Do nothing.
     $node->cid = 0; // Might have a cid from the msg id. This will confuse comment_post. Updating comments via mail does not make sense anyway. GK 
 // DEBUG:
 //          print "<pre>Node received:";
@@ -205,9 +200,9 @@ function listhandler_mailhandler($node, 
 }
 
 /**
-* Find author of a new mailsubmitted comment. Based on some heuristics
-* as the From header, especially the email address.
-*/
+ * Find author of a new mailsubmitted comment. Based on some heuristics
+ * as the From header, especially the email address.
+ */
 function listhandler_find_author($node, $header){
   // we copy the code from  mailhandler_authenticate, need a different ending.
 
@@ -332,13 +327,9 @@ function listhandler_switch_user($newuid
 
 /**
  * Copied and stripped to the bones from user.module
- *
  */
 function listhandler_user_save($array = array()) {
-
-  /*
-  ** Dynamically compose a SQL query:
-  */
+  // Dynamically compose a SQL query:
 
   $user_fields = user_fields();
   $array['created'] = time();
