mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib mhamain.pl,2.53,2.54 mhdb.pl,2.26,2.27 mhinit.pl,2...

2002-12-30 22:03:49
Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib
In directory subversions:/tmp/cvs-serv23355/lib

Modified Files:
	mhamain.pl mhdb.pl mhinit.pl mhrcfile.pl mhrcvars.pl mhutil.pl 
Log Message:
* Added FIELDSTORE resource.


Index: mhamain.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhamain.pl,v
retrieving revision 2.53
retrieving revision 2.54
diff -C2 -r2.53 -r2.54
*** mhamain.pl	19 Dec 2002 05:07:20 -0000	2.53
--- mhamain.pl	31 Dec 2002 05:03:30 -0000	2.54
***************
*** 30,34 ****
  require 5;
  
! $VERSION = '2.5.13+';
  $VINFO =<<EndOfInfo;
    MHonArc v$VERSION (Perl $] $^O)
--- 30,34 ----
  require 5;
  
! $VERSION = '2.5.14+';
  $VINFO =<<EndOfInfo;
    MHonArc v$VERSION (Perl $] $^O)
***************
*** 917,920 ****
--- 917,933 ----
  
      $Refs{$index} = [ @refs ]  if (@refs);
+ 
+     ## Grab any extra fields to store
+     foreach $field (@ExtraHFields) {
+ 	next  unless $fields->{$field};
+ 	if (!defined($tmp = $ExtraHFields{$index})) {
+ 	    $tmp = $ExtraHFields{$index} = { };
+ 	}
+ 	if ($HFieldsAddr{$field}) {
+ 	    $tmp->{$field} = join(', ', @{$fields->{$field}});
+ 	} else {
+ 	    $tmp->{$field} = join(' ', @{$fields->{$field}});
+ 	}
+     }
  
      ($index, $fields);

Index: mhdb.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhdb.pl,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -r2.26 -r2.27
*** mhdb.pl	20 Dec 2002 08:01:11 -0000	2.26
--- mhdb.pl	31 Dec 2002 05:03:30 -0000	2.27
***************
*** 67,70 ****
--- 67,72 ----
  print_var($db,'Refs',        \%Refs);
  print_var($db,'Subject',     \%Subject);
+ print_var($db,'ExtraHFields',\(_at_)ExtraHFields);
+ print_var($db,'ExtraHFields',\%ExtraHFields);
  print_var($db,'TListOrder',  \(_at_)TListOrder);
  print_var($db,'NumOfMsgs',   \$NumOfMsgs);

Index: mhinit.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhinit.pl,v
retrieving revision 2.40
retrieving revision 2.41
diff -C2 -r2.40 -r2.41
*** mhinit.pl	19 Dec 2002 05:07:20 -0000	2.40
--- mhinit.pl	31 Dec 2002 05:03:30 -0000	2.41
***************
*** 194,206 ****
  );
  
! ##	Asocc arrays defining HTML formats to apply to header fields
! 
! %HeadFields = (
!     "-default-", "",		# Nothing
  );
! %HeadHeads = (
!     "-default-", "em",		# Empasize field labels
  );
! @FieldOrder = (			# Order fields are listed
      'to',
      'subject',
--- 194,205 ----
  );
  
! ##	Hash defining HTML formats to apply to header fields
! %HeadFields = (		# Nothing
!     "-default-", "",
  );
! %HeadHeads = (		# Empasize field labels
!     "-default-", "em",
  );
! @FieldOrder = (		# Order fields are listed
      'to',
      'subject',
***************
*** 209,213 ****
      '-extra-',
  );
! %FieldODefs = (			# Fields not to slurp up in "-extra-"
      'to', 1,
      'subject', 1,
--- 208,212 ----
      '-extra-',
  );
! %FieldODefs = (		# Fields not to slurp up in "-extra-"
      'to', 1,
      'subject', 1,
***************
*** 215,218 ****
--- 214,221 ----
      'date', 1,
  );
+ 
+ ##	Extra header fields to store
+ @ExtraHFields = ();
+ %ExtraHFields = ();
  
  ##	Message information variables

Index: mhrcfile.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhrcfile.pl,v
retrieving revision 2.30
retrieving revision 2.31
diff -C2 -r2.30 -r2.31
*** mhrcfile.pl	20 Dec 2002 08:01:11 -0000	2.30
--- mhrcfile.pl	31 Dec 2002 05:03:30 -0000	2.31
***************
*** 188,191 ****
--- 188,201 ----
  	    last FMTSW;
  	}
+ 	if ($elem eq 'fieldstore') {		# Fields to store
+ 	    @ExtraHFields = ()  if $override;
+ 	    while (defined($line = <$handle>)) {
+ 		last  if     $line =~ /^\s*<\/fieldstore\s*>/i;
+ 		next  unless $line =~ /\S/;
+ 		$line =~ s/\s+//g;  $line =~ tr/A-Z/a-z/;
+ 		push(@ExtraHFields, $line);
+ 	    }
+ 	    last FMTSW;
+ 	}
  	if ($elem eq 'fieldstyles') {		# Field text style
  	    while (defined($line = <$handle>)) {

Index: mhrcvars.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhrcvars.pl,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -r2.21 -r2.22
*** mhrcvars.pl	27 Jul 2002 05:13:13 -0000	2.21
--- mhrcvars.pl	31 Dec 2002 05:03:30 -0000	2.22
***************
*** 89,92 ****
--- 89,93 ----
      my($lref, $key, $pos);
      my($arg, $opt) = ("", "");
+     my $isaddr = 0;
  
      ##	Get variable argument string
***************
*** 185,188 ****
--- 186,214 ----
  	    last REPLACESW;
  	}
+ 	if ($var eq 'MSGHFIELD') {	## Message header field
+ 	    $canclip = 1; $raw = 1;
+ 	    ($lref, $key, $pos, $opt) = compute_msg_pos($index, $var, $arg);
+ 	    if (!defined($key)) {
+ 		$tmp = '';
+ 		last REPLACESW;
+ 	    }
+ 	    $opt =~ s/\s+//g;  $opt = lc $opt;
+ 	    HFIELD: {
+ 		my $fields = $ExtraHFields{$key};
+ 		if (defined($fields) && defined($tmp = $fields->{$opt})) {
+ 		    last HFIELD;
+ 		}
+ 		if ($opt eq 'subject') {
+ 		    $tmp = $Subject{$key};
+ 		    $tmp = $NoSubjectTxt  if $tmp eq '';
+ 		    last HFIELD;
+ 		}
+ 		$tmp = '';
+ 	    }
+ 	    if ($HFieldsAddr{$opt}) {
+ 		$isaddr = 1;
+ 	    }
+ 	    last REPLACESW;
+ 	}
      	if ($var eq 'MSGGMTDATE') {	## Message GMT date
  	    ($lref, $key, $pos, $opt) = compute_msg_pos($index, $var, $arg);
***************
*** 633,636 ****
--- 659,672 ----
  	if ($raw) {
  	    $ret = &$MHeadCnvFunc($tmp);
+ 	    if ($isaddr) {
+ 		if ($NOMAILTO) {
+ 		    $ret =~ s/($HAddrExp)/htmlize(rewrite_address($1))/geo;
+ 		} else {
+ 		    $ret =~ s/($HAddrExp)
+ 			     /mailUrl($1, $Index2MsgId{$key},
+ 					  $Subject{$key},
+ 					  $From{$key})/gexo;
+ 		}
+ 	    }
  	} else {
  	    $ret = $tmp;

Index: mhutil.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhutil.pl,v
retrieving revision 2.24
retrieving revision 2.25
diff -C2 -r2.24 -r2.25
*** mhutil.pl	29 Dec 2002 22:19:03 -0000	2.24
--- mhutil.pl	31 Dec 2002 05:03:30 -0000	2.25
***************
*** 29,33 ****
  
  ## RFC 2369 header fields to check for URLs
! my %HFieldsList = (
      'list-archive'  	=> 1,
      'list-help'  	=> 1,
--- 29,33 ----
  
  ## RFC 2369 header fields to check for URLs
! %HFieldsList = (
      'list-archive'  	=> 1,
      'list-help'  	=> 1,
***************
*** 39,43 ****
  
  ## Header fields that contain addresses
! my %HFieldsAddr = (
      'apparently-from'	=> 1,
      'apparently-to'	=> 1,
--- 39,43 ----
  
  ## Header fields that contain addresses
! %HFieldsAddr = (
      'apparently-from'	=> 1,
      'apparently-to'	=> 1,
***************
*** 516,520 ****
  		$fld_text =~ s{($HAddrExp)}
  			      {&htmlize(&rewrite_address($1))
! 			      }gex;
  	    }
  	    last LBLSW;
--- 516,520 ----
  		$fld_text =~ s{($HAddrExp)}
  			      {&htmlize(&rewrite_address($1))
! 			      }gexo;
  	    }
  	    last LBLSW;

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV