comparison mcabber/src/histolog.c @ 177:a51ce78a0e2a

[/trunk] Changeset 189 by mikael * Add a "load_logs" variable to enable logs reading. (Actual reading is not implemented yet...)
author mikael
date Thu, 05 May 2005 08:53:49 +0000
parents 0ed6099b5a54
children cfefae4b6de9
comparison
equal deleted inserted replaced
176:99a99a160113 177:a51ce78a0e2a
30 #include "histolog.h" 30 #include "histolog.h"
31 #include "jabglue.h" 31 #include "jabglue.h"
32 #include "screen.h" 32 #include "screen.h"
33 33
34 static guint UseFileLogging; 34 static guint UseFileLogging;
35 static guint FileLoadLogs;
35 static char *RootDir; 36 static char *RootDir;
36 37
37 38
38 // user_histo_file() 39 // user_histo_file()
39 // Returns history filename for the given jid 40 // Returns history filename for the given jid
94 fclose(fp); 95 fclose(fp);
95 } 96 }
96 97
97 // hlog_enable() 98 // hlog_enable()
98 // Enable logging to files. If root_dir is NULL, then $HOME/.mcabber is used. 99 // Enable logging to files. If root_dir is NULL, then $HOME/.mcabber is used.
99 void hlog_enable(guint enable, char *root_dir) 100 // If loadfiles is TRUE, we will try to load buddies history logs from file.
101 void hlog_enable(guint enable, char *root_dir, guint loadfiles)
100 { 102 {
101 UseFileLogging = enable; 103 UseFileLogging = enable;
104 FileLoadLogs = loadfiles;
102 105
103 if (enable) { 106 if (enable || loadfiles) {
104 if (root_dir) { 107 if (root_dir) {
105 int l = strlen(root_dir); 108 int l = strlen(root_dir);
106 if (l < 1) { 109 if (l < 1) {
107 scr_LogPrint("root_dir too short"); 110 scr_LogPrint("root_dir too short");
108 UseFileLogging = FALSE; 111 UseFileLogging = FALSE;