--- loncom/interface/lonmsg.pm 2008/09/13 02:37:26 1.213 +++ loncom/interface/lonmsg.pm 2008/11/04 04:18:22 1.214 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.213 2008/09/13 02:37:26 raeburn Exp $ +# $Id: lonmsg.pm,v 1.214 2008/11/04 04:18:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -120,6 +120,9 @@ sub packagemsg { ''.$env{'request.role'}.''. ''.$env{'request.filename'}.''. ''.$msgid.''; + if (defined($env{'form.group'})) { + $result .= ''.$env{'form.group'}.''; + } if (ref($recuser) eq 'ARRAY') { for (my $i=0; $i<@{$recuser}; $i++) { if ($type eq 'dcmail') { @@ -688,8 +691,10 @@ sub user_normal_msg_raw { $text,$msgid); } if ($toperm && $userenv{'permanentemail'}) { - &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, - $text,$msgid); + if ((!$userenv{'notification'}) || ($userenv{'notification'} ne $userenv{'permanentemail'})) { + &sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, + $text,$msgid); + } } &Apache::lonnet::log($env{'user.domain'},$env{'user.name'}, $env{'user.home'}, @@ -748,7 +753,7 @@ sub user_normal_msg { } sub process_sent_mail { - my ($msgsubj,$subj_prefix,$numsent,$stamp,$msgname,$msgdom,$msgcount,$context,$pid,$savemsg,$recusers,$recudoms,$baseurl,$attachmenturl,$symb,$error,$senderuname,$senderdom) = @_; + my ($msgsubj,$subj_prefix,$numsent,$stamp,$msgname,$msgdom,$msgcount,$context,$pid,$savemsg,$recusers,$recudoms,$baseurl,$attachmenturl,$symb,$error,$senderuname,$senderdom,$recipid) = @_; my $sentsubj; if ($numsent > 1) { $sentsubj = $subj_prefix.' ('.$numsent.' sent) '.$msgsubj; @@ -763,7 +768,7 @@ sub process_sent_mail { &buildmsgid($stamp,$sentsubj,$msgname,$msgdom,$msgcount,$context,$pid); (undef,my $sentmessage) = &packagemsg($msgsubj,$savemsg,undef,$baseurl,$attachmenturl,$recusers, - $recudoms,$sentmsgid,undef,undef,$symb,$error); + $recudoms,$sentmsgid,undef,undef,$symb,$error,$recipid); my $status = &store_sent_mail($sentmsgid,$sentmessage,$senderuname, $senderdom); return $status;