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

version 1.7, 2001/02/06 18:17:34 version 1.8, 2001/07/26 20:26:43
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 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') || 
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.8


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