changeset 373:1d29321843b0

[gaim-migrate @ 383] raise chat windows and log chat committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 10 Jun 2000 00:48:43 +0000
parents 8c3b075d7aba
children 7493af3a4ce2
files src/buddy_chat.c src/conversation.c src/gaim.h src/prefs.c src/util.c
diffstat 5 files changed, 39 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy_chat.c	Fri Jun 09 10:32:33 2000 +0000
+++ b/src/buddy_chat.c	Sat Jun 10 00:48:43 2000 +0000
@@ -306,6 +306,33 @@
         
         gtk_html_thaw(GTK_HTML(b->text));
         
+	if (general_options & OPT_GEN_POPUP_CHAT)
+		gdk_window_show(b->window->window);
+
+	if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(b->name)) {
+		char *t1;
+		FILE *fd;
+
+		t1 = g_malloc(256);
+		snprintf(t1, 256, "%s.chat", b->name);
+		fd = open_log_file(t1);
+		g_free(t1);
+		if (general_options & OPT_GEN_STRIP_HTML) {
+			t1 = strip_html(message);
+			if (display_options & OPT_DISP_SHOW_TIME)
+				fprintf(fd, "%s %s %s\n", date(), str, t1);
+			else
+				fprintf(fd, "%s %s\n", str, t1);
+			g_free(t1);
+		} else {
+			if (display_options & OPT_DISP_SHOW_TIME)
+				fprintf(fd, "%s %s %s\n", date(), str, message);
+			else
+				fprintf(fd, "%s %s\n", str, message);
+		}
+		fclose(fd);
+	}
+
 	g_free(str);
 	g_free(buf);
 }
--- a/src/conversation.c	Fri Jun 09 10:32:33 2000 +0000
+++ b/src/conversation.c	Sat Jun 10 00:48:43 2000 +0000
@@ -108,7 +108,7 @@
 	if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
 		FILE *fd;
 
-		fd = open_log_file(c);
+		fd = open_log_file(c->name);
 		if (!(general_options & OPT_GEN_STRIP_HTML))
 			fprintf(fd, "<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n", full_date()); 
 		else
@@ -870,7 +870,7 @@
                         } else {
                                 t1 = what;
                         }
-                        fd = open_log_file(c);
+                        fd = open_log_file(c->name);
                         fprintf(fd, "%s\n", t1);
                         fclose(fd);
                         if (general_options & OPT_GEN_STRIP_HTML) {
@@ -1008,7 +1008,7 @@
                                 t1 = buf;
                                 t2 = what;
                         }
-                        fd = open_log_file(c);
+                        fd = open_log_file(c->name);
                         fprintf(fd, "%s%s\n", t1, t2);
                         fclose(fd);
                         if (general_options & OPT_GEN_STRIP_HTML) {
--- a/src/gaim.h	Fri Jun 09 10:32:33 2000 +0000
+++ b/src/gaim.h	Sat Jun 10 00:48:43 2000 +0000
@@ -376,7 +376,7 @@
 #define TYPE_SIGNOFF   4
 #define TYPE_KEEPALIVE 5
 
-#define REVISION "gaim:$Revision: 381 $"
+#define REVISION "gaim:$Revision: 383 $"
 #define FLAPON "FLAPON\r\n\r\n"
 
 #define ROAST "Tic/Toc"
@@ -454,6 +454,7 @@
 #define OPT_GEN_DISCARD_WHEN_AWAY 0x00002000
 #define OPT_GEN_NEAR_APPLET	0x00004000
 #define OPT_GEN_CHECK_SPELLING	0x00008000
+#define OPT_GEN_POPUP_CHAT	0x00010000
 
 extern int display_options;
 #define OPT_DISP_SHOW_TIME       0x00000001
@@ -533,7 +534,7 @@
 extern void aol_icon(GdkWindow *);
 extern int query_state();
 extern void set_state(int);
-extern FILE *open_log_file (struct conversation *c);
+extern FILE *open_log_file (char *);
 extern char *sec_to_text(int);
 extern struct aim_user *find_user(const char *);
 extern char *full_date();
--- a/src/prefs.c	Fri Jun 09 10:32:33 2000 +0000
+++ b/src/prefs.c	Sat Jun 10 00:48:43 2000 +0000
@@ -387,6 +387,7 @@
 	gaim_button(_("Log All Conversations"), &general_options, OPT_GEN_LOG_ALL, genbox);
 	gaim_button(_("Strip HTML from log files"), &general_options, OPT_GEN_STRIP_HTML, genbox);
 	gaim_button(_("Raise windows when message recieved"), &general_options, OPT_GEN_POPUP_WINDOWS, genbox);
+	gaim_button(_("Raise chat windows when people speak"), &general_options, OPT_GEN_POPUP_CHAT, genbox);
         gaim_button(_("Send URLs as links"), &general_options, OPT_GEN_SEND_LINKS, genbox);
 	gaim_button(_("Show Lag-O-Meter"), &general_options, OPT_GEN_SHOW_LAGMETER, genbox);
         gaim_button(_("Save some window size/positions"), &general_options, OPT_GEN_SAVED_WINDOWS, genbox);
--- a/src/util.c	Fri Jun 09 10:32:33 2000 +0000
+++ b/src/util.c	Sat Jun 10 00:48:43 2000 +0000
@@ -305,7 +305,7 @@
 }
 
 
-FILE *open_log_file (struct conversation *c)
+FILE *open_log_file (char *name)
 {
         char *buf;
         char *buf2;
@@ -318,7 +318,7 @@
 
         if (!(general_options & OPT_GEN_LOG_ALL)) {
 
-                l = find_log_info(c->name);
+                l = find_log_info(name);
                 if (!l)
                         return NULL;
 
@@ -329,7 +329,7 @@
 
                 if (flag) { /* is a new file */
                         fprintf(fd, "<HTML><HEAD><TITLE>" );
-                        fprintf(fd, "IM Sessions with %s", c->name );
+                        fprintf(fd, "IM Sessions with %s", name );
                         fprintf(fd, "</TITLE></HEAD><BODY BGCOLOR=\"ffffff\">\n" );
                 }
 
@@ -381,7 +381,7 @@
                 fclose(fd);
 
         
-        g_snprintf(log_all_file, 256, "%s/.gaim/%s/%s.log", getenv("HOME"), current_user->username, normalize(c->name));
+        g_snprintf(log_all_file, 256, "%s/.gaim/%s/%s.log", getenv("HOME"), current_user->username, normalize(name));
 
         if (stat(log_all_file, &st) < 0)
                 flag = 1;
@@ -393,7 +393,7 @@
 
         if (flag) { /* is a new file */
 		fprintf(fd, "<HTML><HEAD><TITLE>" );
-		fprintf(fd, "IM Sessions with %s", c->name );
+		fprintf(fd, "IM Sessions with %s", name );
 		fprintf(fd, "</TITLE></HEAD><BODY BGCOLOR=\"ffffff\">\n" );
         }