[vhffs-dev] [390] Listengine: Add a little protection to prevent loop when the mail of the mailing list is added to the member list

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 390
Author:   gradator
Date:     2007-01-07 01:51:54 +0000 (Sun, 07 Jan 2007)

Log Message:
-----------
Listengine: Add a little protection to prevent loop when the mail of the mailing list is added to the member list

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-listengine/src/listengine.pl
    trunk/vhffs-listengine/src/listengine.pl


Modified: branches/vhffs_4.1/vhffs-listengine/src/listengine.pl
===================================================================
--- branches/vhffs_4.1/vhffs-listengine/src/listengine.pl	2007-01-07 00:49:20 UTC (rev 389)
+++ branches/vhffs_4.1/vhffs-listengine/src/listengine.pl	2007-01-07 01:51:54 UTC (rev 390)
@@ -412,7 +412,7 @@
 {
     my $mail = shift;
     my $list = shift;
-    
+    my $listmail = $list->get_localpart . "\@" . $list->get_domain;
     my $subs = $list->get_members;
    
     my @tos;
@@ -435,7 +435,7 @@
     foreach ( keys %{$subs} )
     {
 	#Send mail to user if he is a confirmed subscriber
-	push( @tos , $_ ) if( $subs->{$_}{perm} != Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY );
+	push( @tos , $_ ) if( $subs->{$_}{perm} != Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY  &&  $subs->{$_}{member} ne $listmail );
     }
 
  

Modified: trunk/vhffs-listengine/src/listengine.pl
===================================================================
--- trunk/vhffs-listengine/src/listengine.pl	2007-01-07 00:49:20 UTC (rev 389)
+++ trunk/vhffs-listengine/src/listengine.pl	2007-01-07 01:51:54 UTC (rev 390)
@@ -411,7 +411,7 @@
 {
     my $mail = shift;
     my $list = shift;
-    
+    my $listmail = $list->get_localpart . "\@" . $list->get_domain;
     my $subs = $list->get_members;
    
     my @tos;
@@ -434,7 +434,7 @@
     foreach ( keys %{$subs} )
     {
 	#Send mail to user if he is a confirmed subscriber
-	push( @tos , $_ ) if( $subs->{$_}{perm} != Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY );
+	push( @tos , $_ ) if( $subs->{$_}{perm} != Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY  &&  $subs->{$_}{member} ne $listmail );
     }
 
  


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/