[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Sat, 18 Aug 2007 00:32:52 -0000


albertel		Fri Aug 17 20:32:52 2007 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  - switch from calling critical directly to using cput
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.209 loncom/interface/lonmsg.pm:1.210
--- loncom/interface/lonmsg.pm:1.209	Wed May  9 20:50:52 2007
+++ loncom/interface/lonmsg.pm	Fri Aug 17 20:32:52 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.209 2007/05/10 00:50:52 albertel Exp $
+# $Id: lonmsg.pm,v 1.210 2007/08/18 00:32:52 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -511,10 +511,8 @@
                                   undef,undef,undef,undef,undef,undef,undef,
                                   undef,$recipid);
        if ($sendback) { $packed_message.='<sendback>true</sendback>'; }
-       $status=&Apache::lonnet::critical(
-           'put:'.$domain.':'.$user.':critical:'.
-           &escape($msgid).'='.
-           &escape($packed_message),$homeserver);
+       $status=&Apache::lonnet::cput('critical', {$msgid => $packed_message},
+				     $domain,$user);
         if (defined($sentmessage)) {
             $$sentmessage = $packed_message;
         }
@@ -651,10 +649,9 @@
                                      undef,$crsmsgid,$symb,$error,$recipid);
 
 # Store in user folder
-       $status=&Apache::lonnet::critical(
-           'put:'.$domain.':'.$user.':nohist_email:'.
-           &escape($msgid).'='.
-           &escape($packed_message),$homeserver);
+       $status=
+	   &Apache::lonnet::cput('nohist_email',{$msgid => $packed_message},
+				 $domain,$user);
 # Save new message received time
        &Apache::lonnet::put
                          ('email_status',{'recnewemail'=>time},$domain,$user);
@@ -740,7 +737,7 @@
 }
 
 sub process_sent_mail {
-    my ($msgsubj,$subj_prefix,$numsent,$stamp,$msgname,$msgdom,$msgcount,$context,$pid,$savemsg,$recusers,$recudoms,$baseurl,$attachmenturl,$symb,$error,$senderuname,$senderdom,$senderhome) = @_;
+    my ($msgsubj,$subj_prefix,$numsent,$stamp,$msgname,$msgdom,$msgcount,$context,$pid,$savemsg,$recusers,$recudoms,$baseurl,$attachmenturl,$symb,$error,$senderuname,$senderdom) = @_;
     my $sentsubj;
     if ($numsent > 1) {
         $sentsubj = $subj_prefix.' ('.$numsent.' sent) '.$msgsubj;
@@ -757,24 +754,21 @@
         &packagemsg($msgsubj,$savemsg,undef,$baseurl,$attachmenturl,$recusers,
                     $recudoms,$sentmsgid,undef,undef,$symb,$error);
     my $status = &store_sent_mail($sentmsgid,$sentmessage,$senderuname,
-                                  $senderdom,$senderhome);
+                                  $senderdom);
     return $status;
 }
 
 sub store_sent_mail {
-    my ($msgid,$message,$senderuname,$senderdom,$senderhome) = @_;
+    my ($msgid,$message,$senderuname,$senderdom) = @_;
     if ($senderuname eq '') {
         $senderuname = $env{'user.name'};
     }
     if ($senderdom eq '') {
         $senderdom = $env{'user.domain'};
     }
-    if ($senderhome eq '') {
-        $senderhome = $env{'user.home'};
-    }
-    my $status =' '.&Apache::lonnet::critical(
-               'put:'.$senderdom.':'.$senderuname.':nohist_email_sent:'.
-               &escape($msgid).'='.&escape($message),$senderhome);
+    my $status =' '.&Apache::lonnet::cput('nohist_email_sent',
+					  {$msgid => $message},
+					  $senderdom,$senderuname);
     return $status;
 }