Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib
In directory subversions:/tmp/cvs-serv8495/lib
Modified Files:
mhamain.pl mhdb.pl mhexternal.pl mhidxrc.pl mhinit.pl
mhnull.pl mhrcfile.pl mhrcvars.pl mhtxthtml.pl mhtxtplain.pl
readmail.pl
Log Message:
* BUG FIX: #2474.
* Added the following resources:
TENDBUTTON Button to last message in thread.
TENDBUTTONIA Inactive button to last message in thread.
TENDLINKIA Inactive link to last message in thread.
TENDLINK Link to last message in thread.
TEXTENCODE Encode message text to given character encoding.
TTOPBUTTON Button to first message in thread.
TTOPBUTTONIA Inactive button to first message in thread.
TTOPLINKIA Inactive link to first message in thread.
TTOPLINK Link to first message in thread.
Index: mhamain.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhamain.pl,v
retrieving revision 2.57
retrieving revision 2.58
diff -C2 -r2.57 -r2.58
*** mhamain.pl 16 Jan 2003 16:57:21 -0000 2.57
--- mhamain.pl 4 Feb 2003 23:31:19 -0000 2.58
***************
*** 30,34 ****
require 5;
! $VERSION = '2.5.14+';
$VINFO =<<EndOfInfo;
MHonArc v$VERSION (Perl $] $^O)
--- 30,34 ----
require 5;
! $VERSION = '2.6.0-';
$VINFO =<<EndOfInfo;
MHonArc v$VERSION (Perl $] $^O)
Index: mhdb.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhdb.pl,v
retrieving revision 2.30
retrieving revision 2.31
diff -C2 -r2.30 -r2.31
*** mhdb.pl 9 Jan 2003 23:42:28 -0000 2.30
--- mhdb.pl 4 Feb 2003 23:31:19 -0000 2.31
***************
*** 382,385 ****
--- 382,393 ----
print_var($db,'TSLICEBEG', \$TSLICEBEG) unless $IsDefault{'TSLICEBEG'};
print_var($db,'TSLICEEND', \$TSLICEEND) unless $IsDefault{'TSLICEEND'};
+ print_var($db,'TTOPBUTTON', \$TTOPBUTTON) unless $IsDefault{'TTOPBUTTON'};
+ print_var($db,'TTOPBUTTONIA', \$TTOPBUTTONIA) unless $IsDefault{'TTOPBUTTONIA'};
+ print_var($db,'TENDBUTTON', \$TENDBUTTON) unless $IsDefault{'TENDBUTTON'};
+ print_var($db,'TENDBUTTONIA', \$TENDBUTTONIA) unless $IsDefault{'TENDBUTTONIA'};
+ print_var($db,'TTOPLINK', \$TTOPLINK) unless $IsDefault{'TTOPLINK'};
+ print_var($db,'TTOPLINKIA', \$TTOPLINKIA) unless $IsDefault{'TTOPLINKIA'};
+ print_var($db,'TENDLINK', \$TENDLINK) unless $IsDefault{'TENDLINK'};
+ print_var($db,'TENDLINKIA', \$TENDLINKIA) unless $IsDefault{'TENDLINKIA'};
print_var($db,'TNEXTTOPBUTTON', \$TNEXTTOPBUTTON)
unless $IsDefault{'TNEXTTOPBUTTON'};
Index: mhexternal.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhexternal.pl,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -r2.13 -r2.14
*** mhexternal.pl 4 Jan 2003 02:57:14 -0000 2.13
--- mhexternal.pl 4 Feb 2003 23:31:19 -0000 2.14
***************
*** 106,110 ****
sub filter {
my($fields, $data, $isdecode, $args) = @_;
! my($ret, $filename, $urlfile, $disp);
require 'mhmimetypes.pl';
--- 106,110 ----
sub filter {
my($fields, $data, $isdecode, $args) = @_;
! my($ret, $filename, $urlfile);
require 'mhmimetypes.pl';
***************
*** 112,116 ****
$args = '' unless defined($args);
my $name = '';
- my $nameparm = '';
my $ctype = '';
my $type = '';
--- 112,115 ----
***************
*** 143,147 ****
## Get disposition
! ($disp, $nameparm) = readmail::MAILhead_get_disposition($fields);
$name = $nameparm if $usename;
&debug("Content-type: $ctype",
--- 142,147 ----
## Get disposition
! my($disp, $nameparm, $raw_name, $html_name) =
! readmail::MAILhead_get_disposition($fields, 1);
$name = $nameparm if $usename;
&debug("Content-type: $ctype",
***************
*** 230,234 ****
if ($is_mesg && ($$data =~ /^subject:\s(.+)$/mi)) {
! $namelabel = mhonarc::htmlize($1);
$desc .= 'Message attachment';
} else {
--- 230,235 ----
if ($is_mesg && ($$data =~ /^subject:\s(.+)$/mi)) {
! #$namelabel = mhonarc::htmlize($1);
! $namelabel = readmail::MAILdecode_1522_str($1);
$desc .= 'Message attachment';
} else {
***************
*** 236,240 ****
$type;
if ($nameparm) {
! $namelabel = mhonarc::htmlize($nameparm);
} else {
$namelabel = $filename;
--- 237,242 ----
$type;
if ($nameparm) {
! #$namelabel = mhonarc::htmlize($nameparm);
! $namelabel = $html_name;
} else {
$namelabel = $filename;
Index: mhidxrc.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhidxrc.pl,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -r2.13 -r2.14
*** mhidxrc.pl 2 Jan 2003 04:20:05 -0000 2.13
--- mhidxrc.pl 4 Feb 2003 23:31:19 -0000 2.14
***************
*** 502,505 ****
--- 502,514 ----
$IsDefault{'TPREVTOPBUTTONIA'} = 1 unless $TPREVTOPBUTTONIA;
+ $TTOPBUTTON = '[<a href="$MSG(TTOP)$">First in Thread</a>]',
+ $IsDefault{'TTOPBUTTON'} = 1 unless $TTOPBUTTON;
+ $TTOPBUTTONIA = '[First in Thread]',
+ $IsDefault{'TTOPBUTTONIA'} = 1 unless $TTOPBUTTONIA;
+ $TENDBUTTON = '[<a href="$MSG(TEND)$">Last in Thread</a>]',
+ $IsDefault{'TENDBUTTON'} = 1 unless $TENDBUTTON;
+ $TENDBUTTONIA = '[Last in Thread]',
+ $IsDefault{'TENDBUTTONIA'} = 1 unless $TENDBUTTONIA;
+
## Next message by thread link
unless ($TNEXTLINK) {
***************
*** 573,576 ****
--- 582,609 ----
## Inactive prev thread
$TPREVTOPLINKIA = '', $IsDefault{'TPREVTOPLINKIA'} = 1 unless $TPREVTOPLINKIA;
+
+ ## First in thread
+ unless ($TTOPLINK) {
+ $TTOPLINK =<<'EndOfStr';
+ <li>First in thread:
+ <strong><a href="$MSG(TTOP)$">$SUBJECT(TTOP)$</a></strong>
+ </li>
+ EndOfStr
+ $IsDefault{'TTOPLINK'} = 1;
+ }
+ ## Inactive first in thread
+ $TTOPLINKIA = '', $IsDefault{'TTOPLINKIA'} = 1 unless $TTOPLINKIA;
+
+ ## Last in thread
+ unless ($TENDLINK) {
+ $TENDLINK =<<'EndOfStr';
+ <li>Last in thread:
+ <strong><a href="$MSG(TEND)$">$SUBJECT(TEND)$</a></strong>
+ </li>
+ EndOfStr
+ $IsDefault{'TENDLINK'} = 1;
+ }
+ ## Inactive last in thread
+ $TENDLINKIA = '', $IsDefault{'TENDLINKIA'} = 1 unless $TENDLINKIA;
## Top links in message
Index: mhinit.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhinit.pl,v
retrieving revision 2.45
retrieving revision 2.46
diff -C2 -r2.45 -r2.46
*** mhinit.pl 9 Jan 2003 23:42:28 -0000 2.45
--- mhinit.pl 4 Feb 2003 23:31:19 -0000 2.46
***************
*** 538,541 ****
--- 538,546 ----
$TPREVBUTTONIA = ''; # Thread Previous inactive button template
+ $TTOPBUTTON = ''; # Top of thread button template
+ $TTOPBUTTONIA = ''; # Top of thread inactive button template
+ $TENDBUTTON = ''; # End of thread button template
+ $TENDBUTTONIA = ''; # End of thread inactive button template
+
$TNEXTTOPBUTTON = ''; # Next Thread button template
$TNEXTTOPBUTTONIA = ''; # Next Thread inactive button template
***************
*** 552,555 ****
--- 557,565 ----
$TPREVLINK = ''; # Thread Previous link template
$TPREVLINKIA = ''; # Thread Previous inactive link template
+
+ $TTOPLINK = ''; # Top of thread link template
+ $TTOPLINKIA = ''; # Top of thread inactive link template
+ $TENDLINK = ''; # End of thread link template
+ $TENDLINKIA = ''; # End of thread inactive link template
$TNEXTTOPLINK = ''; # Next Thread link template
Index: mhnull.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhnull.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** mhnull.pl 17 Sep 2001 16:10:30 -0000 1.7
--- mhnull.pl 4 Feb 2003 23:31:19 -0000 1.8
***************
*** 36,43 ****
my($fields, $data, $isdecode, $args) = @_;
my($ctype) = $fields->{'content-type'}[0] =~ m%^\s*([\w\-\./]+)%;
! my($disp, $nameparm) = readmail::MAILhead_get_disposition($fields);
join("", '<p><tt><<',
($disp ? "$disp: " : ""),
! ($nameparm ? $nameparm : $ctype),
'>></tt></p>');
}
--- 36,44 ----
my($fields, $data, $isdecode, $args) = @_;
my($ctype) = $fields->{'content-type'}[0] =~ m%^\s*([\w\-\./]+)%;
! my($disp, $nameparm, $raw_name, $html_name) =
! readmail::MAILhead_get_disposition($fields, 1);
join("", '<p><tt><<',
($disp ? "$disp: " : ""),
! ($html_name ? $html_name : $ctype),
'>></tt></p>');
}
Index: mhrcfile.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhrcfile.pl,v
retrieving revision 2.33
retrieving revision 2.34
diff -C2 -r2.33 -r2.34
*** mhrcfile.pl 9 Jan 2003 23:42:28 -0000 2.33
--- mhrcfile.pl 4 Feb 2003 23:31:19 -0000 2.34
***************
*** 882,885 ****
--- 882,901 ----
if $readmail::TextDefCharset eq '';
}
+ if ($elem eq 'tendbutton') { # End of thread button
+ $TENDBUTTON = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'tendbuttonia') {
+ $TENDBUTTONIA = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'tendlink') { # End of thread link
+ $TENDLINK = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'tendlinkia') {
+ $TENDLINKIA = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
if ($elem eq 'textencode') { # Text encoder
$readmail::TextEncode = undef;
***************
*** 1247,1250 ****
--- 1263,1282 ----
if ($elem eq 'tprevtoplinkia') {
$TPREVTOPLINKIA = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'ttopbutton') { # Top of thread button
+ $TTOPBUTTON = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'ttopbuttonia') {
+ $TTOPBUTTONIA = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'ttoplink') { # Top of thread link
+ $TTOPLINK = &get_elem_content($handle, $elem, $chop);
+ last FMTSW;
+ }
+ if ($elem eq 'ttoplinkia') {
+ $TTOPLINKIA = &get_elem_content($handle, $elem, $chop);
last FMTSW;
}
Index: mhrcvars.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhrcvars.pl,v
retrieving revision 2.24
retrieving revision 2.25
diff -C2 -r2.24 -r2.25
*** mhrcvars.pl 10 Jan 2003 03:35:40 -0000 2.24
--- mhrcvars.pl 4 Feb 2003 23:31:19 -0000 2.25
***************
*** 340,343 ****
--- 340,349 ----
$tmp = defined($key) ? $TPREVTOPBUTTON : $TPREVTOPBUTTONIA;
last SW; }
+ if ($arg eq 'TTOP') {
+ $tmp = ($key ne $index) ? $TTOPBUTTON : $TTOPBUTTONIA;
+ last SW; }
+ if ($arg eq 'TEND') {
+ $tmp = ($key ne $index) ? $TENDBUTTON : $TENDBUTTONIA;
+ last SW; }
}
last REPLACESW;
***************
*** 370,373 ****
--- 376,385 ----
if ($arg eq 'TPREVTOP') {
$tmp = defined($key) ? $TPREVTOPLINK : $TPREVTOPLINKIA;
+ last SW; }
+ if ($arg eq 'TTOP') {
+ $tmp = ($key ne $index) ? $TTOPLINK : $TTOPLINKIA;
+ last SW; }
+ if ($arg eq 'TEND') {
+ $tmp = ($key ne $index) ? $TENDLINK : $TENDLINKIA;
last SW; }
}
Index: mhtxthtml.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhtxthtml.pl,v
retrieving revision 2.30
retrieving revision 2.31
diff -C2 -r2.30 -r2.31
*** mhtxthtml.pl 22 Dec 2002 00:48:17 -0000 2.30
--- mhtxthtml.pl 4 Feb 2003 23:31:20 -0000 2.31
***************
*** 109,113 ****
## Check if content-disposition should be checked
if ($args =~ /\battachcheck\b/i) {
! my($disp, $nameparm) = readmail::MAILhead_get_disposition($fields);
if ($disp =~ /\battachment\b/i) {
require 'mhexternal.pl';
--- 109,114 ----
## Check if content-disposition should be checked
if ($args =~ /\battachcheck\b/i) {
! my($disp, $nameparm, $raw) =
! readmail::MAILhead_get_disposition($fields);
if ($disp =~ /\battachment\b/i) {
require 'mhexternal.pl';
Index: mhtxtplain.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/mhtxtplain.pl,v
retrieving revision 2.37
retrieving revision 2.38
diff -C2 -r2.37 -r2.38
*** mhtxtplain.pl 18 Jan 2003 03:17:12 -0000 2.37
--- mhtxtplain.pl 4 Feb 2003 23:31:20 -0000 2.38
***************
*** 126,130 ****
## Check if content-disposition should be checked
if ($args =~ /\battachcheck\b/i) {
! my($disp, $nameparm) = readmail::MAILhead_get_disposition($fields);
if ($disp =~ /\battachment\b/i) {
require 'mhexternal.pl';
--- 126,131 ----
## Check if content-disposition should be checked
if ($args =~ /\battachcheck\b/i) {
! my($disp, $nameparm, $raw) =
! readmail::MAILhead_get_disposition($fields);
if ($disp =~ /\battachment\b/i) {
require 'mhexternal.pl';
Index: readmail.pl
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/readmail.pl,v
retrieving revision 2.31
retrieving revision 2.32
diff -C2 -r2.31 -r2.32
*** readmail.pl 18 Jan 2003 03:01:34 -0000 2.31
--- readmail.pl 4 Feb 2003 23:31:20 -0000 2.32
***************
*** 18,22 ****
## $hash_ref = MAILread_header($mesg_str_ref);
##
! ## ($disp, $file) = MAILhead_get_disposition($fields_hash_ref);
## $boolean = MAILis_excluded($content_type);
## $parm_hash_ref = MAILparse_parameter_str($header_field);
--- 18,23 ----
## $hash_ref = MAILread_header($mesg_str_ref);
##
! ## ($disp, $file, $raw, $html_name) =
! ## MAILhead_get_disposition($fields_hash_ref, $do_html);
## $boolean = MAILis_excluded($content_type);
## $parm_hash_ref = MAILparse_parameter_str($header_field);
***************
*** 917,922 ****
##
sub MAILhead_get_disposition {
! my($hfields) = shift;
! my($disp, $filename) = ('', '');
local($_);
--- 918,926 ----
##
sub MAILhead_get_disposition {
! my $hfields = shift;
! my $do_html = shift;
!
! my($disp, $filename, $raw) = ('', '', '');
! my $html_name = undef;
local($_);
***************
*** 925,945 ****
($disp) = /^\s*([^\s;]+)/;
if (/filename="([^"]+)"/i) {
! $filename = $1;
} elsif (/filename=(\S+)/i) {
! ($filename = $1) =~ s/;\s*$//g;
}
}
! if (!$filename && defined($_ = $hfields->{'content-type'}[0])) {
if (/name="([^"]+)"/i) {
! $filename = $1;
} elsif (/name=(\S+)/i) {
! ($filename = $1) =~ s/;\s*$//g;
}
}
! $filename = MAILdecode_1522_str($filename, DECODE_ALL);
$filename =~ s%.*[/\\:]%%; # Remove any path component
$filename =~ s/^\s+//; # Remove leading whitespace
$filename =~ s/\s+$//; # Remove trailing whitespace
! ($disp, $filename);
}
--- 929,955 ----
($disp) = /^\s*([^\s;]+)/;
if (/filename="([^"]+)"/i) {
! $raw = $1;
} elsif (/filename=(\S+)/i) {
! ($raw = $1) =~ s/;\s*$//g;
}
}
! if (!$raw && defined($_ = $hfields->{'content-type'}[0])) {
if (/name="([^"]+)"/i) {
! $raw = $1;
} elsif (/name=(\S+)/i) {
! ($raw = $1) =~ s/;\s*$//g;
}
}
! $filename = MAILdecode_1522_str($raw, DECODE_ALL);
$filename =~ s%.*[/\\:]%%; # Remove any path component
$filename =~ s/^\s+//; # Remove leading whitespace
$filename =~ s/\s+$//; # Remove trailing whitespace
! $filename =~ tr/\0-\40\t\n\r?:*"'<>|\177-\377/_/;
! # Remove questionable/invalid characters
!
! # Only provide HTML display version if requested
! $html_name = MAILdecode_1522_str($raw) if $do_html;
!
! ($disp, $filename, $raw, $html_name);
}
---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV