From: Sean E. <sea...@us...> - 2003-11-18 04:39:54
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv26548/src Modified Files: conversation.c gtkprefs.c log.c Log Message: Logginations Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.569 retrieving revision 1.570 diff -u -d -p -r1.569 -r1.570 --- conversation.c 14 Nov 2003 18:09:31 -0000 1.569 +++ conversation.c 18 Nov 2003 04:39:49 -0000 1.570 @@ -807,7 +807,8 @@ gaim_conversation_new(GaimConversationTy conv->history = g_string_new(""); conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); - conv->log = gaim_log_new(GAIM_LOG_IM, name, account, time(NULL)); + conv->log = gaim_log_new(type == GAIM_CONV_IM ? GAIM_LOG_IM : + type == GAIM_CONV_CHAT ? GAIM_LOG_CHAT : GAIM_LOG_IM, name, account, time(NULL)); if (type == GAIM_CONV_IM) Index: gtkprefs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkprefs.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -p -r1.91 -r1.92 --- gtkprefs.c 5 Nov 2003 06:15:49 -0000 1.91 +++ gtkprefs.c 18 Nov 2003 04:39:50 -0000 1.92 @@ -1328,7 +1328,7 @@ GtkWidget *logging_page() { "/gaim/gtk/logging/log_ims", vbox); prefs_checkbox(_("Log all c_hats"), "/gaim/gtk/logging/log_chats", vbox); - +/* vbox = gaim_gtk_make_frame (ret, _("System Logs")); prefs_checkbox(_("Log when buddies _sign on/sign off"), "/gaim/gtk/logging/log_signon_signoff", vbox); @@ -1340,7 +1340,7 @@ GtkWidget *logging_page() { "/gaim/gtk/logging/log_own_states", vbox); prefs_checkbox(_("I_ndividual log file for each buddy's signons"), "/gaim/gtk/logging/individual_logs", vbox); - +*/ gtk_widget_show_all(ret); return ret; } Index: log.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/log.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -p -r1.57 -r1.58 --- log.c 17 Nov 2003 22:29:42 -0000 1.57 +++ log.c 18 Nov 2003 04:39:50 -0000 1.58 @@ -65,7 +65,9 @@ void gaim_log_write(GaimLog *log, GaimMe g_return_if_fail(log->logger); g_return_if_fail(log->logger->write); - (log->logger->write)(log, type, from, time, message); + if ( (gaim_prefs_get_bool("/gaim/gtk/logging/log_chats") && log->type == GAIM_LOG_CHAT) || + (gaim_prefs_get_bool("/gaim/gtk/logging/log_ims") && log->type == GAIM_LOG_IM)) + (log->logger->write)(log, type, from, time, message); } char *gaim_log_read(GaimLog *log, GaimLogReadFlags *flags) @@ -191,6 +193,8 @@ GList *gaim_log_get_logs(const char *nam void gaim_log_init(void) { gaim_prefs_add_none("/core/logging"); + gaim_prefs_add_bool("/gaim/gtk/logging/log_ims", FALSE); + gaim_prefs_add_bool("/gaim/gtk/logging/log_chats", FALSE); gaim_prefs_add_string("/core/logging/format", "txt"); gaim_log_logger_add(&html_logger); gaim_log_logger_add(&txt_logger); @@ -390,12 +394,19 @@ static void html_logger_write(GaimLog *l /* This log is new */ char *ud = gaim_user_dir(); char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account))); + char *chat; const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL); char *dir; char *filename; FILE *file; + if (log->type == GAIM_LOG_CHAT) { + chat = g_strdup_printf("%s.chat", guy); + g_free(guy); + guy = chat; + } + strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.html", localtime(&log->time)); dir = g_build_filename(ud, "logs", NULL); @@ -519,11 +530,17 @@ static void txt_logger_write(GaimLog *lo char *ud = gaim_user_dir(); char *filename; char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account))); + char *chat; const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL); char *dir; FILE *file; + if (log->type == GAIM_LOG_CHAT) { + chat = g_strdup_printf("%s.chat", guy); + g_free(guy); + guy = chat; + } strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.txt", localtime(&log->time)); dir = g_build_filename(ud, "logs", NULL); |