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

kaisler kaisler@source.lon-capa.org
Tue, 31 Mar 2009 21:04:12 -0000


kaisler		Tue Mar 31 21:04:12 2009 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm lonmsgdisplay.pm 
  Log:
  Update the display for new Messages in the toplevelmenu, if you go on the message site the display in the toplevelmenu now is cleard
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.223 loncom/interface/lonmsg.pm:1.224
--- loncom/interface/lonmsg.pm:1.223	Sun Mar 29 20:05:06 2009
+++ loncom/interface/lonmsg.pm	Tue Mar 31 21:04:12 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.223 2009/03/29 20:05:06 kaisler Exp $
+# $Id: lonmsg.pm,v 1.224 2009/03/31 21:04:12 kaisler Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -562,7 +562,7 @@
 
 sub mynewmail{
 	&newmail();
-	return $env{'user.mailcheck.status'};
+	return $env{'user.mailcheck.lastnewmassagetime'} > $env{'user.mailcheck.lastvisit'};
 }
 
 
@@ -570,7 +570,7 @@
     if ((time-$env{'user.mailcheck.time'})>300) {
         my %what=&Apache::lonnet::get('email_status',['recnewemail']);
         &Apache::lonnet::appenv({'user.mailcheck.time'=>time});
-		&Apache::lonnet::appenv({'user.mailcheck.status'=> $what{'recnewemail'}>0 ? 1 : 0});
+		&Apache::lonnet::appenv({'user.mailcheck.lastnewmassagetime'=> $what{'recnewemail'}});
         if ($what{'recnewemail'}>0) { return 1; }
     }
     return 0;
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.119 loncom/interface/lonmsgdisplay.pm:1.120
--- loncom/interface/lonmsgdisplay.pm:1.119	Fri Mar 27 16:18:04 2009
+++ loncom/interface/lonmsgdisplay.pm	Tue Mar 31 21:04:12 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.119 2009/03/27 16:18:04 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.120 2009/03/31 21:04:12 kaisler Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -136,6 +136,9 @@
 
     );
 
+	# set se lastvisit for the new mail check in the toplevel menu
+	&Apache::lonnet::appenv({'user.mailcheck.lastvisit'=>time});
+
     my %actions = &Apache::lonlocal::texthash(
                                 view => 'View Folder',
                                 rename => 'Rename Folder',