- foreach my $sender (ReturnSenders $userid, $type, $next, $lines, $date) {
- my @msgs = ReturnMessages $userid, $sender;
- my @msgs2 = @msgs;
+ for my $sender (ReturnSenders(
+ userid => $userid,
+ type => $type,
+ start_at => $next,
+ lines => $lines,
+ date => $date
+ )) {
+ my $msgs = ReturnMessages(
+ userid => $userid,
+ sender => $sender,
+ );
+
+ # This is for the purposes of supplying a subject line if the mailto address
+ # is clicked on. It's kludgy because we are simply grabbing the subject line
+ # of the first email sent where there may be many emails from this sender.
+ # Still it is often the right subject (or a good enough one)
+ #
+ # A little tricky here because of transliteration. If I test for
+ # $msg->[0]{subject} when $msg->[0] is essentially empty I create the hash
+ # making it non empty. Therefore I need to first test if $msgs->[0] exists
+ # first.
+ my $heading = '';
+
+ if ($msgs->[0]) {
+ $heading = $msgs->[0]{subject} if $msgs->[0]{subject};
+ } # if
+
+ my ($onlist, $seq);