[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Tue, 03 Jan 2006 03:18:58 -0000
raeburn Mon Jan 2 22:18:58 2006 EDT
Modified files:
/loncom/interface lonmsg.pm
Log:
Speed up message display. Do not retrieve course description if $fromcid is '' (no course) or only digits (i.e., process id in old style msgid - rev 1.140 and earlier).
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.165 loncom/interface/lonmsg.pm:1.166
--- loncom/interface/lonmsg.pm:1.165 Wed Dec 21 17:58:07 2005
+++ loncom/interface/lonmsg.pm Mon Jan 2 22:18:58 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.165 2005/12/21 22:58:07 raeburn Exp $
+# $Id: lonmsg.pm,v 1.166 2006/01/03 03:18:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -860,7 +860,10 @@
my $msgid=&Apache::lonnet::escape($_);
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($msgid,$folder);
- my $description = &get_course_desc($fromcid);
+ my $description;
+ if ($fromcid) {
+ $description = &get_course_desc($fromcid);
+ }
my @temp1 = ($sendtime,$shortsubj,$fromname,$fromdomain,$status,
$msgid,$description);
# Check whether message was sent during blocking period.
@@ -915,7 +918,8 @@
sub get_course_desc {
my ($fromcid) = @_;
- my $description;
+ my $description;
+ if ($fromcid =~ /^\d+$/) { return $description; }
if (defined($env{'course.'.$fromcid.'.description'})) {
$description = $env{'course.'.$fromcid.'.description'};
} else {
@@ -955,7 +959,10 @@
my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)=
&Apache::lonmsg::unpackmsgid($_);
if (defined($sendtime) && $sendtime!~/error/) {
- my $description = &get_course_desc($fromcid);
+ my $description;
+ if ($fromcid) {
+ $description = &get_course_desc($fromcid);
+ }
my $numsendtime = $sendtime;
$sendtime = &Apache::lonlocal::locallocaltime($sendtime);
if ($status eq 'new') {