Diff for /loncom/interface/lonmsg.pm between versions 1.168 and 1.169

version 1.168, 2006/01/05 19:52:52 version 1.169, 2006/01/05 20:10:54
Line 267  sub buildmsgid { Line 267  sub buildmsgid {
 }  }
   
 sub unpackmsgid {  sub unpackmsgid {
     my ($msgid,$folder,$skipstatus)=@_;      my ($msgid,$folder,$skipstatus,$status_cache)=@_;
     $msgid=&Apache::lonnet::unescape($msgid);      $msgid=&Apache::lonnet::unescape($msgid);
     my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid,      my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid,
                      $processid)=split(/\:/,&Apache::lonnet::unescape($msgid));                       $processid)=split(/\:/,&Apache::lonnet::unescape($msgid));
     if (!defined($processid)) { $fromcid = ''; }      if (!defined($processid)) { $fromcid = ''; }
     my %status=();      my %status=();
     unless ($skipstatus) {      unless ($skipstatus) {
         my $suffix=&foldersuffix($folder);   if (ref($status_cache)) {
         %status=&Apache::lonnet::get('email_status'.$suffix,[$msgid]);      $status{$msgid} = $status_cache->{$msgid};
         if ($status{$msgid}=~/^error\:/) { $status{$msgid}=''; }   } else {
       my $suffix=&foldersuffix($folder);
       %status=&Apache::lonnet::get('email_status'.$suffix,[$msgid]);
    }
    if ($status{$msgid}=~/^error\:/) { $status{$msgid}=''; }
         unless ($status{$msgid}) { $status{$msgid}='new'; }          unless ($status{$msgid}) { $status{$msgid}='new'; }
     }      }
     return ($sendtime,$shortsubj,$fromname,$fromdomain,$status{$msgid},$fromcid);      return ($sendtime,$shortsubj,$fromname,$fromdomain,$status{$msgid},$fromcid);
Line 859  sub sortedmessages { Line 863  sub sortedmessages {
     #unpack the varibles and repack into temp for sorting      #unpack the varibles and repack into temp for sorting
     my @temp;      my @temp;
     my %descriptions;      my %descriptions;
       my %status_cache = 
    &Apache::lonnet::get('email_status'.&foldersuffix($folder),\@messages);
     foreach (@messages) {      foreach (@messages) {
  my $msgid=&Apache::lonnet::escape($_);   my $msgid=&Apache::lonnet::escape($_);
  my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=   my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=
     &Apache::lonmsg::unpackmsgid($msgid,$folder);      &Apache::lonmsg::unpackmsgid($msgid,$folder,undef,
    \%status_cache);
         my $description = &get_course_desc($fromcid,\%descriptions);          my $description = &get_course_desc($fromcid,\%descriptions);
  my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status,   my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status,
      $msgid,$description);       $msgid,$description);
Line 951  sub disnew { Line 958  sub disnew {
        'op' => 'Open',         'op' => 'Open',
        'do' => 'Domain'         'do' => 'Domain'
        );         );
     my @msgids = sort split(/\&/,&Apache::lonnet::reply      my @msgids = sort(&Apache::lonnet::getkeys('nohist_email'));
                             ('keys:'.$env{'user.domain'}.':'.  
                              $env{'user.name'}.':nohist_email',  
                              $env{'user.home'}));  
     my @newmsgs;      my @newmsgs;
     my %setters = ();      my %setters = ();
     my $startblock = 0;      my $startblock = 0;
Line 963  sub disnew { Line 967  sub disnew {
     my $numblocked = 0;      my $numblocked = 0;
     # Check for blocking of display because of scheduled online exams.      # Check for blocking of display because of scheduled online exams.
     &blockcheck(\%setters,\$startblock,\$endblock);      &blockcheck(\%setters,\$startblock,\$endblock);
       my %status_cache = 
    &Apache::lonnet::get('email_status',\@msgids);
     my %descriptions;      my %descriptions;
     foreach (@msgids) {      foreach (@msgids) {
    my $msgid=&Apache::lonnet::escape($_);
         my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=          my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=
     &Apache::lonmsg::unpackmsgid($_);      &Apache::lonmsg::unpackmsgid($msgid,undef,undef,\%status_cache);
         if (defined($sendtime) && $sendtime!~/error/) {          if (defined($sendtime) && $sendtime!~/error/) {
             my $description = &get_course_desc($fromcid,\%descriptions);              my $description = &get_course_desc($fromcid,\%descriptions);
             my $numsendtime = $sendtime;              my $numsendtime = $sendtime;
Line 977  sub disnew { Line 984  sub disnew {
                     $numblocked ++;                      $numblocked ++;
                 } else {                  } else {
                     push @newmsgs, {                       push @newmsgs, { 
                         msgid    => $_,                          msgid    => $msgid,
                         sendtime => $sendtime,                          sendtime => $sendtime,
                         shortsub => &Apache::lonnet::unescape($shortsubj),                          shortsub => &Apache::lonnet::unescape($shortsubj),
                         from     => $fromname,                          from     => $fromname,

Removed from v.1.168  
changed lines
  Added in v.1.169


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>