Diff for /loncom/interface/lonmsg.pm between versions 1.7 and 1.10

version 1.7, 2001/02/06 18:17:34 version 1.10, 2001/07/27 20:17:14
Line 83  sub unpackmsgid { Line 83  sub unpackmsgid {
     my $msgid=&Apache::lonnet::unescape(shift);      my $msgid=&Apache::lonnet::unescape(shift);
     my ($sendtime,$shortsubj,$fromname,$fromdomain)=split(/\:/,      my ($sendtime,$shortsubj,$fromname,$fromdomain)=split(/\:/,
                           &Apache::lonnet::unescape($msgid));                            &Apache::lonnet::unescape($msgid));
     my %status=&Apache::lonnet::get('email_status',$msgid);      my %status=&Apache::lonnet::get('email_status',[$msgid]);
     if ($status{$msgid}=~/^error\:/) { $status{$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});      return ($sendtime,$shortsubj,$fromname,$fromdomain,$status{$msgid});
Line 151  sub user_crit_received { Line 151  sub user_crit_received {
                      $contents{'subject'}.'" dated '.$contents{'time'}.".\n\n"                       $contents{'subject'}.'" dated '.$contents{'time'}.".\n\n"
                      .'Message ID: '.$contents{'msgid'});                       .'Message ID: '.$contents{'msgid'});
     $status.=' trans: '.      $status.=' trans: '.
      &Apache::lonnet::put('nohist_email',$contents{'msgid'} => $message);       &Apache::lonnet::put('nohist_email',{$contents{'msgid'} => $message});
     $status.=' del: '.      $status.=' del: '.
      &Apache::lonnet::del('critical',$contents{'msgid'});       &Apache::lonnet::del('critical',[$contents{'msgid'}]);
     &Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'},      &Apache::lonnet::log($ENV{'user.domain'},$ENV{'user.name'},
                          $ENV{'user.home'},'Received critical message '.                           $ENV{'user.home'},'Received critical message '.
                          $contents{'msgid'}.                           $contents{'msgid'}.
Line 189  sub user_normal_msg { Line 189  sub user_normal_msg {
   
 sub statuschange {  sub statuschange {
     my ($msgid,$newstatus)=@_;      my ($msgid,$newstatus)=@_;
     my %status=&Apache::lonnet::get('email_status',$msgid);      my %status=&Apache::lonnet::get('email_status',[$msgid]);
     if ($status{$msgid}=~/^error\:/) { $status{$msgid}=''; }      if ($status{$msgid}=~/^error\:/) { $status{$msgid}=''; }
     unless ($status{$msgid}) { $status{$msgid}='new'; }      unless ($status{$msgid}) { $status{$msgid}='new'; }
     unless (($status{$msgid} eq 'replied') ||       unless (($status{$msgid} eq 'replied') || 
             ($status{$msgid} eq 'forwarded')) {              ($status{$msgid} eq 'forwarded')) {
  &Apache::lonnet::put('email_status',($msgid => $newstatus));   &Apache::lonnet::put('email_status',{$msgid => $newstatus});
     }      }
 }  }
 # ===================================================================== Handler  # ===================================================================== Handler
Line 233  sub handler { Line 233  sub handler {
   if ($ENV{'form.display'}) {    if ($ENV{'form.display'}) {
       my $msgid=$ENV{'form.display'};        my $msgid=$ENV{'form.display'};
       &statuschange($msgid,'read');        &statuschange($msgid,'read');
       my %message=&Apache::lonnet::get('nohist_email',$msgid);        my %message=&Apache::lonnet::get('nohist_email',[$msgid]);
       my %content=&unpackagemsg($message{$msgid});        my %content=&unpackagemsg($message{$msgid});
       $r->print('<b>Subject:</b> '.$content{'subject'}.        $r->print('<b>Subject:</b> '.$content{'subject'}.
              '<br><b>From:</b> '.$content{'sendername'}.' at '.               '<br><b>From:</b> '.$content{'sendername'}.' at '.
Line 244  sub handler { Line 244  sub handler {
              $content{'message'}.'</pre><hr>'.$content{'citation'});               $content{'message'}.'</pre><hr>'.$content{'citation'});
   } elsif ($ENV{'form.replyto'}) {    } elsif ($ENV{'form.replyto'}) {
       my $msgid=$ENV{'form.replyto'};        my $msgid=$ENV{'form.replyto'};
       my %message=&Apache::lonnet::get('nohist_email',$msgid);        my %message=&Apache::lonnet::get('nohist_email',[$msgid]);
       my %content=&unpackagemsg($message{$msgid});        my %content=&unpackagemsg($message{$msgid});
       my $quotemsg='> '.$content{'message'};        my $quotemsg='> '.$content{'message'};
       $quotemsg=~s/\r/\n/g;        $quotemsg=~s/\r/\n/g;
Line 263  $quotemsg Line 263  $quotemsg
 ENDREPLY  ENDREPLY
   } elsif ($ENV{'form.sendreply'}) {    } elsif ($ENV{'form.sendreply'}) {
       my $msgid=$ENV{'form.sendreply'};        my $msgid=$ENV{'form.sendreply'};
       my %message=&Apache::lonnet::get('nohist_email',$msgid);        my %message=&Apache::lonnet::get('nohist_email',[$msgid]);
       my %content=&unpackagemsg($message{$msgid});        my %content=&unpackagemsg($message{$msgid});
       &statuschange($msgid,'replied');        &statuschange($msgid,'replied');
       $r->print('Sending: '.&user_normal_msg($content{'sendername'},        $r->print('Sending: '.&user_normal_msg($content{'sendername'},

Removed from v.1.7  
changed lines
  Added in v.1.10


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