--- loncom/interface/lonmsg.pm 2006/01/10 02:11:17 1.171 +++ loncom/interface/lonmsg.pm 2006/01/23 23:15:51 1.173 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.171 2006/01/10 02:11:17 banghart Exp $ +# $Id: lonmsg.pm,v 1.173 2006/01/23 23:15:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -296,8 +296,8 @@ sub sendemail { $msg->to($to); $msg->subject('[LON-CAPA] '.$subject); if (my $fh = $msg->open()) { - print $fh $body; - $fh->close; + print $fh $body; + $fh->close; } } @@ -307,7 +307,7 @@ sub sendnotification { my ($to,$touname,$toudom,$subj,$crit,$text)=@_; my $sender=$env{'environment.firstname'}.' '.$env{'environment.lastname'}; unless ($sender=~/\w/) { - $sender=$env{'user.name'}.'@'.$env{'user.domain'}; + $sender=$env{'user.name'}.'@'.$env{'user.domain'}; } my $critical=($crit?' critical':''); $text=~s/\<\;/\time},$domain,$user); @@ -561,7 +565,7 @@ sub user_normal_msg_raw { (&Apache::lonnet::allowed('srm',$env{'request.course.id'}) || &Apache::lonnet::allowed('srm',$env{'request.course.id'}. '/'.$env{'request.course.sec'})))) { - $status .= &store_sent_mail($msgid,$message); + $status .= &store_sent_mail($msgid,$packed_message_no_citation); } } else { $status='no_host'; @@ -570,7 +574,7 @@ sub user_normal_msg_raw { $$newid = $msgid; } if (defined($sentmessage)) { - $$sentmessage = $message; + $$sentmessage = $packed_message; } # Notifications @@ -610,14 +614,16 @@ sub user_normal_msg { my $msgforward=$userenv{'msgforward'}; if ($msgforward) { foreach (split(/\,/,$msgforward)) { - my ($forwuser,$forwdomain)=split(/\:/,$_); - $status.= + my ($forwuser,$forwdomain)=split(/\:/,$_); + $status.= &user_normal_msg_raw($forwuser,$forwdomain,$subject,$message, - $citation,$baseurl,$attachmenturl,$toperm,undef,undef,$sentmessage).' '; + $citation,$baseurl,$attachmenturl,$toperm, + undef,undef,$sentmessage).' '; } } else { - $status=&user_normal_msg_raw($user,$domain,$subject,$message, - $citation,$baseurl,$attachmenturl,$toperm,undef,undef,$sentmessage); + $status=&user_normal_msg_raw($user,$domain,$subject,$message, + $citation,$baseurl,$attachmenturl,$toperm, + undef,undef,$sentmessage); } return $status; } @@ -2029,9 +2035,10 @@ sub displayresource { $content{'sendername'}, $content{'senderdomain'}, $content{'courseid'}); - } else { + } elsif ($env{'user.adv'}) { return $content{'citation'}; } + return ''; } # ================================================================== The Header