[LON-CAPA-cvs] cvs: loncom / lond

www lon-capa-cvs@mail.lon-capa.org
Tue, 09 Sep 2003 20:47:46 -0000


www		Tue Sep  9 16:47:46 2003 EDT

  Modified files:              
    /loncom	lond 
  Log:
  Permanently store chatroom entries in chatroom.log
  
  
Index: loncom/lond
diff -u loncom/lond:1.141 loncom/lond:1.142
--- loncom/lond:1.141	Mon Sep  8 06:32:07 2003
+++ loncom/lond	Tue Sep  9 16:47:46 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.141 2003/09/08 10:32:07 foxr Exp $
+# $Id: lond,v 1.142 2003/09/09 20:47:46 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -60,6 +60,9 @@
 # 09/08/2003 Ron Fox:  Told lond to take care of change logging so we
 #      don't have to remember it:
 # $Log: lond,v $
+# Revision 1.142  2003/09/09 20:47:46  www
+# Permanently store chatroom entries in chatroom.log
+#
 # Revision 1.141  2003/09/08 10:32:07  foxr
 # Added PushFile sub This sub oversees the push of a new configuration table file
 # Currently supported files are:
@@ -90,7 +93,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.141 $'; #' stupid emacs
+my $VERSION='$Revision: 1.142 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid;
 my $currentdomainid;
@@ -2043,10 +2046,10 @@
     my %hash;
     my $proname=&propath($cdom,$cname);
     my @entries=();
+    my $time=time;
     if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",
 	    &GDBM_WRCREAT(),0640)) {
 	@entries=map { $_.':'.$hash{$_} } sort keys %hash;
-	my $time=time;
 	my ($lastid)=($entries[$#entries]=~/^(\w+)\:/);
 	my ($thentime,$idnum)=split(/\_/,$lastid);
 	my $newid=$time.'_000000';
@@ -2065,6 +2068,12 @@
 	    }
 	}
 	untie %hash;
+    }
+    {
+	my $hfh;
+	if ($hfh=IO::File->new(">>$proname/chatroom.log")) { 
+	    print $hfh "$time:".&unescape($newchat)."\n";
+	}
     }
 }