mhonarc-users

Re: subject header & thread button patches (2.3.3)

1999-04-06 14:49:18
Thanks for responding so quickly!

Your patches did not come through.

I added them again.  My mail pseudo-bounced according to Christopher Lindsey 
<lindsey(_at_)ncsa(_dot_)uiuc(_dot_)edu> which may have been the reason they 
didn't come
through.
(Then again, they are mime attachments which may be rejected by majordomo.)

subject_header.patch: When ADDing a message, the subject header isn't
rewritten for messages to be updated.  I only fixed the part I was using.

Could you please elaborate?

You are right.  The doc makes this clear, but I didn't pick it up at first.
Perhaps it would be good to add a "*" or something to the resource list 
index and put "not/rewritable" or "not/updatable" in a prominent location 
on the resource's page.

The docs covering what is rewritable, including the FAQ. 

Didn't see this in the FAQ.  I just read the whole thing again.
One question even led me the other way:

    Q: Can I make changes to message formatting on existing archived
    messages?

    A:[...]can change the default meaning of the resource so it
     really outputs something else entirely. 

How 'bout a question like: "Why aren't my links getting updated when a new
message is added?"  This is what I asked when I went to look at the code.
I read the manual carefully (honest!), but I didn't get the impression
that only some resources were "rewritable" while others weren't.  I only
understood this in the context that you have to pass EDITIDX when you change
a resource for archived messages (not affected by the current ADD).
When I read the code, it was obvious certain sections don't get rewritten
which I incorrectly thought was a bug.

However, the
information may not be centralized.  Please provide specifics on what
parts of the generated pages you are refering to.

For performance reasons it makes sense to not update every section
although it makes it cumbersome for the configurer.

"by thread", I think it's useful to tell people when they are at the end of
the thread.  Perhaps a new button could be added (CURRTNEXT/PREV)?  I don't
[...]
An alternative is to use $TSLICE$.  This will probably serve you better
without the need to modify code.

As I understand TSLICE, it species a fixed number of messages to go backward
and forward within the whole thread list (@TListOrder).  My patch changes
the meaning of BUTTON(TNEXT/PREV) to be active only if the next/prev message
is part of a particular thread.  TSLICE is a view into all threads.  My
patch defines a view into only one thread.  Again, I'm not asking you to
change the meaning of TNEXT/PREV, just thought you'd like to know how someone
else viewed the meaning of these and perhaps it would be nice to have new
buttons defined with the alternate meaning.

One last question:  In the FAQ, it says you don't need to respecify the rcfile
when adding messages.  However, under the section describing majordomo usage,
it specifies the -rc flag in the list alias.  Is the alias example incorrect?
(I cut and pasted the majordomo example.)

Again, thanks for the response.  MHonArc is a great tool.

Rob
===================================================================
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** mhamain.pl  1999/04/04 03:29:42     1.1
--- mhamain.pl  1999/04/05 04:55:18     1.2
***************
*** 967,972 ****
--- 967,982 ----
      }
      print $msghandle "\n<!--X-TopPNI-End-->\n";
  
+     if ($adding) {
+       while (<$msginfh>) { last  if /<!--X-Subject-Header-End/; }
+     }
+     print $msghandle "<!--X-MsgBody-->\n";
+     print $msghandle "<!--X-Subject-Header-Begin-->\n";
+     ($template = $SUBJECTHEADER) =~
+       s/$VarExp/&replace_li_var($1,$index)/geo;
+     print $msghandle $template;
+     print $msghandle "<!--X-Subject-Header-End-->\n";
+ 
      ## Output message data
      if ($adding) {
        $tmp2 = '';
***************
*** 978,990 ****
        print $msghandle $tmp2;
  
      } else {
-       print $msghandle "<!--X-MsgBody-->\n";
-       print $msghandle "<!--X-Subject-Header-Begin-->\n";
-       ($template = $SUBJECTHEADER) =~
-           s/$VarExp/&replace_li_var($1,$index)/geo;
-       print $msghandle $template;
-       print $msghandle "<!--X-Subject-Header-End-->\n";
- 
        $MsgHead{$index} =~ s%($AddrExp)%&link_refmsgid($1)%geo;
        $Message{$index} =~ s%($AddrExp)%&link_refmsgid($1)%geo;
  
--- 988,993 ----
===================================================================
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** mhthread.pl 1999/04/04 03:29:42     1.1
--- mhthread.pl 1999/04/05 04:56:33     1.2
***************
*** 209,214 ****
--- 209,215 ----
      %HasRefDepth = ();
      %Replies   = ();
      %SReplies          = ();
+     %FirstInThread = ();
  
      ##        Sort by date first for subject based threads
      @ThreadList = sort increase_index keys %Subject;
***************
*** 234,241 ****
        if (@refs = split(/$X/o, $Refs{$index})) {
            $depth = 0;
            while ($msgid = pop(@refs)) {
!               if (($refindex = $MsgId{$msgid})) {
! 
                    $HasRef{$index} = $refindex;
                    $HasRefDepth{$index} = $depth;
                    if ($Replies{$refindex}) {
--- 235,241 ----
        if (@refs = split(/$X/o, $Refs{$index})) {
            $depth = 0;
            while ($msgid = pop(@refs)) {
!               if ($refindex = $MsgId{$msgid}) {
                    $HasRef{$index} = $refindex;
                    $HasRefDepth{$index} = $depth;
                    if ($Replies{$refindex}) {
***************
*** 254,260 ****
        if (!$HasRef{$index}) {
            if (($refindex = $FirstSub2Index{$stripsub{$index}}) &&
                ($refindex ne $index)) {
- 
                $HasRef{$index} = $refindex;
                $HasRefDepth{$index} = 0;
                if ($SReplies{$refindex}) {
--- 254,259 ----
***************
*** 270,275 ****
--- 269,275 ----
      @ThreadList = &t_sort_messages();
      foreach $index (@ThreadList) {
        unless ($Counted{$index} || $HasRef{$index}) {
+           $FirstInThread{$index} = $index;
            &do_thread($index, 0);
        }
      }
***************
*** 283,288 ****
--- 283,290 ----
  ##
  sub do_thread {
      local($idx, $level) = ($_[0], $_[1]);
+     return if $Counted{$idx};
+ 
      local(@repls, @srepls) = ();
  
      ## Get replies
***************
*** 301,311 ****
--- 303,315 ----
  
      if (@repls) {
        foreach (@repls) {
+           $FirstInThread{$_} = $FirstInThread{$idx};
            &do_thread($_, $level + 1 + $HasRefDepth{$_});
        }
      }
      if (@srepls) {
        foreach (@srepls) {
+           $FirstInThread{$_} = $FirstInThread{$idx};
            &do_thread($_, $level + 1 + $HasRefDepth{$_});
        }
      }
===================================================================
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** mhrcvars.pl 1999/04/04 03:29:42     1.1
--- mhrcvars.pl 1999/04/05 04:56:33     1.2
***************
*** 115,122 ****
            $isfirst    = ($Index2MLoc{$index} == 0);
            $islast     = ($Index2MLoc{$index} == $#MListOrder);
        }
!       $tisfirst       = ($Index2TLoc{$index} == 0);
!       $tislast        = ($Index2TLoc{$index} == $#TListOrder);
      }
  
      ##        Do variable replacement
--- 115,125 ----
            $isfirst    = ($Index2MLoc{$index} == 0);
            $islast     = ($Index2MLoc{$index} == $#MListOrder);
        }
!       $tisfirst = $FirstInThread{$index} eq $index;
!       $tislast = $Index2TLoc{$index} == $#TListOrder
!           || !$SReplies{$index} && !$Replies{$index}
!          && $FirstInThread{$TListOrder[$Index2TLoc{$index} + 1]}
!              ne $FirstInThread{$index};
      }
  
      ##        Do variable replacement
***************
*** 556,562 ****
            if $arg eq "" or $arg eq 'CUR';
        $ofs = ($flip ? 1 : -1), last SW
            if $arg eq 'PREV';
!       $ofs = ($flip ? -1 : 1), last SW
            if $arg eq 'NEXT';
        $ofs = ($flip ? $aref->[$#$aref] : $aref->[0]), last SW
            if $arg eq 'FIRST';
--- 559,565 ----
            if $arg eq "" or $arg eq 'CUR';
        $ofs = ($flip ? 1 : -1), last SW
            if $arg eq 'PREV';
!       $ofs = ($flip ? -1 : 1), last SW,
            if $arg eq 'NEXT';
        $ofs = ($flip ? $aref->[$#$aref] : $aref->[0]), last SW
            if $arg eq 'FIRST';
<Prev in Thread] Current Thread [Next in Thread>