diff -Naur ytalk-3.1.1/Makefile.in ytalk-3.1.1-modified/Makefile.in
--- ytalk-3.1.1/Makefile.in	Sat Nov 14 22:53:52 1998
+++ ytalk-3.1.1-modified/Makefile.in	Fri May 14 17:32:24 1999
@@ -41,7 +41,7 @@
 RM	= rm -f
 
 OBJ = main.o term.o user.o fd.o comm.o menu.o socket.o rc.o exec.o cwin.o \
-      xwin.o
+      xwin.o dump.o
 
 SRC = $(OBJ:.o=.c)
 
diff -Naur ytalk-3.1.1/dump.c ytalk-3.1.1-modified/dump.c
--- ytalk-3.1.1/dump.c	Wed Dec 31 19:00:00 1969
+++ ytalk-3.1.1-modified/dump.c	Fri May 14 20:01:52 1999
@@ -0,0 +1,89 @@
+#include <stdio.h>
+#include <time.h>
+#include "header.h"
+
+void addch_dump(yuser *user, ychar c);
+void newline_dump(yuser *user);
+void dump_dump(yuser *user);
+
+static FILE *dump_fp = NULL;
+
+static void dump_if_ready(yuser *user)
+{
+    if (!dump_fp) return;
+
+    /* Emergency dump to avoid segfault */
+    if (user->dump_buf_len == DUMP_BUF_SIZE) dump_dump(user);
+    
+    /* Gracefull dump (2 newlines) */
+    if (user->dump_buf_len > 1 &&
+	user->dump_buf[user->dump_buf_len-1] == '\n' &&
+	user->dump_buf[user->dump_buf_len-2] == '\n' ) 
+    {
+	dump_dump(user);
+    }
+}
+
+
+static void add_to_dump_buf(yuser *user, ychar c)
+{
+    if (!dump_fp) return;
+
+    user->dump_buf[user->dump_buf_len] = c;
+    ++user->dump_buf_len;
+
+}
+
+void addch_dump(yuser *user, ychar c)
+{
+    if (!dump_fp) return;
+
+    add_to_dump_buf(user,c);
+    dump_if_ready(user);
+}
+
+void newline_dump(yuser *user)
+{
+    if (!dump_fp) return;
+
+    add_to_dump_buf(user,'\n');
+    dump_if_ready(user);
+}
+
+void rub_dump(yuser *user)
+{
+    if (!dump_fp) return;
+
+    if (user->dump_buf_len > 0) user->dump_buf_len -= 2;
+}
+
+void dump_dump(yuser *user)
+{
+    char buf[1024];
+    time_t t = time(NULL);
+
+    if (!dump_fp) return;
+
+    add_to_dump_buf(user,'\0');
+
+    sprintf(buf,"%s",asctime(localtime(&t)));
+    buf[strlen(buf)-1] = '\0';	/* kill '\n' */
+    
+    fprintf(dump_fp,
+	    "%s (%s):\n%s",
+	    user->full_name,
+	    buf,
+	    user->dump_buf);
+    fflush(dump_fp);
+
+    user->dump_buf_len = 0;
+}
+
+void set_file_dump(char *fn) 
+{
+    dump_fp = fopen(fn,"w");
+    if (!dump_fp) 
+	fprintf(stderr,
+		"Warning: Can not open %s, "
+		"no record of conversation will be kept\n",fn);
+}
diff -Naur ytalk-3.1.1/header.h ytalk-3.1.1-modified/header.h
--- ytalk-3.1.1/header.h	Sun May  9 20:53:59 1999
+++ ytalk-3.1.1-modified/header.h	Fri May 14 19:59:32 1999
@@ -130,6 +130,11 @@
     void (*dfunc)();		/* function to call with drained data */
     int got_oob;		/* got OOB flag */
 
+#define DUMP_BUF_SIZE 4095
+    char dump_buf[DUMP_BUF_SIZE+1];
+    int dump_buf_len;
+    
+
     /* anything below this is available for the terminal interface */
 
     yterm term;			/* terminal cookie */
diff -Naur ytalk-3.1.1/main.c ytalk-3.1.1-modified/main.c
--- ytalk-3.1.1/main.c	Sun May  9 18:44:21 1999
+++ ytalk-3.1.1-modified/main.c	Fri May 14 20:02:09 1999
@@ -180,6 +180,13 @@
             vhost = *argv++;
  	    argc -= 2;
         }
+	else if (strcmp(*argv, "-d") == 0)
+	{
+	    argv++;
+	    set_file_dump(*argv);
+	    argv++;
+	    argc -= 2;
+	}
 	else if(strcmp(*argv, "-s") == 0)
 	{
 	    sflg++;	/* immediately start a shell */
diff -Naur ytalk-3.1.1/term.c ytalk-3.1.1-modified/term.c
--- ytalk-3.1.1/term.c	Sat Nov 14 21:23:33 1998
+++ ytalk-3.1.1-modified/term.c	Fri May 14 19:54:12 1999
@@ -290,6 +290,7 @@
 {
     if (is_printable(c))
     {
+	addch_dump(user,c);
 	_addch_term(user, c);
 	user->scr[user->y][user->x] = c;
 	if(++(user->x) >= user->cols)
@@ -490,6 +491,7 @@
 	    move_term(user, user->y, user->x - 1);
 	}
 
+	rub_dump(user);
     }
 }
 
@@ -543,6 +545,7 @@
 {
     register int new_y, next_y;
 
+    newline_dump(user);
     new_y = user->y + 1;
     if(user->flags & FL_RAW)
     {
@@ -736,6 +739,8 @@
 {
     register ychar *c;
     register int i;
+
+    printf("num=%d\n",num);
 
     /* find number of remaining non-blank chars */
 
diff -Naur ytalk-3.1.1/ytalk.1 ytalk-3.1.1-modified/ytalk.1
--- ytalk-3.1.1/ytalk.1	Sun May  9 21:45:47 1999
+++ ytalk-3.1.1-modified/ytalk.1	Sat May 15 13:37:54 1999
@@ -12,7 +12,7 @@
 .SH NAME
 ytalk - A multi-user chat program. 
 .SH SYNOPSIS
-ytalk [-x] [-s] [-Y] [-i] [-h hostname_or_ip] username...
+ytalk [-x] [-s] [-Y] [-i] [-h hostname_or_ip] [-d filename] username...
 .SH DESCRIPTION
 .I YTalk V3.1.1
 .PP
@@ -55,6 +55,10 @@
 .PP
 The -Y option requires a capital Y or N as an answer to any yes/no
 question.
+.PP
+The -d option specifies the name of a file to which the session will
+be recorded.  This will dump text, along with name, date and time, to
+a file every time two newlines are sent.
 .PP
 For each user on the command line, YTalk will attempt to connect to the talk
 daemon on the specified user's host and determine if that user has left an
