author | Mikael Berthe <mikael@lilotux.net> |
Thu, 30 Nov 2006 19:51:09 +0100 | |
changeset 1058 | c0d44a9a99bc |
parent 899 | a833f3d6119a |
child 1106 | 8e12137fab20 |
permissions | -rw-r--r-- |
110 | 1 |
/* |
699 | 2 |
* histolog.c -- File history handling |
395
3e4f2f98c0bf
Whitespace cleanup (histolog.c)
Mikael Berthe <mikael@lilotux.net>
parents:
394
diff
changeset
|
3 |
* |
699 | 4 |
* Copyright (C) 2005, 2006 Mikael Berthe <bmikael@lists.lilotux.net> |
110 | 5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; either version 2 of the License, or (at |
|
9 |
* your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, but |
|
12 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 |
* General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|
19 |
* USA |
|
20 |
*/ |
|
21 |
||
22 |
#include <string.h> |
|
23 |
#include <stdlib.h> |
|
24 |
#include <time.h> |
|
113 | 25 |
#include <ctype.h> |
26 |
#include <sys/types.h> |
|
27 |
#include <sys/stat.h> |
|
28 |
#include <fcntl.h> |
|
110 | 29 |
|
30 |
#include "histolog.h" |
|
178 | 31 |
#include "hbuf.h" |
113 | 32 |
#include "jabglue.h" |
241 | 33 |
#include "utils.h" |
378
2e6c7b1440d1
Improve debugging/logging
Mikael Berthe <mikael@lilotux.net>
parents:
374
diff
changeset
|
34 |
#include "logprint.h" |
635
d4119cb85aeb
New "load_muc_logs" option
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
35 |
#include "settings.h" |
727
1c3620668857
Expand tabs when reading history files
Mikael Berthe <mikael@lilotux.net>
parents:
699
diff
changeset
|
36 |
#include "utils.h" |
110 | 37 |
|
38 |
static guint UseFileLogging; |
|
177 | 39 |
static guint FileLoadLogs; |
110 | 40 |
static char *RootDir; |
41 |
||
42 |
||
1058 | 43 |
// user_histo_file(jid) |
110 | 44 |
// Returns history filename for the given jid |
45 |
// Note: the caller *must* free the filename after use (if not null). |
|
1058 | 46 |
static char *user_histo_file(const char *bjid) |
110 | 47 |
{ |
48 |
char *filename; |
|
186 | 49 |
char *lowerid, *p; |
178 | 50 |
if (!UseFileLogging && !FileLoadLogs) return NULL; |
110 | 51 |
|
1058 | 52 |
lowerid = g_strdup(bjid); |
186 | 53 |
for (p=lowerid; *p ; p++) |
54 |
*p = tolower(*p); |
|
55 |
||
1058 | 56 |
filename = g_new(char, strlen(RootDir) + strlen(bjid) + 1); |
110 | 57 |
strcpy(filename, RootDir); |
186 | 58 |
strcat(filename, lowerid); |
59 |
g_free(lowerid); |
|
110 | 60 |
return filename; |
61 |
} |
|
62 |
||
178 | 63 |
// write_histo_line() |
110 | 64 |
// Adds a history (multi-)line to the jid's history logfile |
1058 | 65 |
static void write_histo_line(const char *bjid, |
113 | 66 |
time_t timestamp, guchar type, guchar info, const char *data) |
110 | 67 |
{ |
68 |
guint len = 0; |
|
113 | 69 |
FILE *fp; |
110 | 70 |
time_t ts; |
113 | 71 |
const char *p; |
178 | 72 |
char *filename; |
241 | 73 |
char str_ts[20]; |
273 | 74 |
int err; |
110 | 75 |
|
178 | 76 |
if (!UseFileLogging) return; |
77 |
||
1058 | 78 |
filename = user_histo_file(bjid); |
110 | 79 |
|
80 |
// If timestamp is null, get current date |
|
81 |
if (timestamp) |
|
82 |
ts = timestamp; |
|
83 |
else |
|
84 |
time(&ts); |
|
85 |
||
86 |
if (!data) |
|
87 |
data = ""; |
|
88 |
||
89 |
// Count number of extra lines |
|
90 |
for (p=data ; *p ; p++) |
|
91 |
if (*p == '\n') len++; |
|
92 |
||
241 | 93 |
/* Line format: "TI yyyymmddThh:mm:ssZ [data]" |
94 |
* (Old format: "TI DDDDDDDDDD LLL [data])" |
|
95 |
* T=Type, I=Info, yyyymmddThh:mm:ssZ=date, LLL=0-padded-len |
|
110 | 96 |
* |
97 |
* Types: |
|
98 |
* - M message Info: S (send) R (receive) |
|
352 | 99 |
* - S status Info: [_oifdna] |
110 | 100 |
* We don't check them, we'll trust the caller. |
101 |
*/ |
|
102 |
||
113 | 103 |
fp = fopen(filename, "a"); |
155 | 104 |
g_free(filename); |
273 | 105 |
if (!fp) { |
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
106 |
scr_LogPrint(LPRINT_LOGNORM, "Unable to write history " |
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
107 |
"(cannot open logfile)"); |
273 | 108 |
return; |
109 |
} |
|
178 | 110 |
|
241 | 111 |
to_iso8601(str_ts, ts); |
273 | 112 |
err = fprintf(fp, "%c%c %-18.18s %03d %s\n", type, info, str_ts, len, data); |
113 | 113 |
fclose(fp); |
273 | 114 |
if (err < 0) { |
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
115 |
scr_LogPrint(LPRINT_LOGNORM, "Error while writing to log file: %s", |
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
116 |
strerror(errno)); |
273 | 117 |
} |
110 | 118 |
} |
119 |
||
178 | 120 |
// hlog_read_history() |
121 |
// Reads the jid's history logfile |
|
1058 | 122 |
void hlog_read_history(const char *bjid, GList **p_buddyhbuf, guint width) |
178 | 123 |
{ |
124 |
char *filename; |
|
125 |
guchar type, info; |
|
126 |
char *data, *tail; |
|
727
1c3620668857
Expand tabs when reading history files
Mikael Berthe <mikael@lilotux.net>
parents:
699
diff
changeset
|
127 |
char *xtext; |
184 | 128 |
time_t timestamp; |
129 |
guint prefix_flags; |
|
178 | 130 |
guint len; |
131 |
FILE *fp; |
|
197 | 132 |
struct stat bufstat; |
193 | 133 |
guint err = 0; |
248 | 134 |
guint ln = 0; // line number |
899
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
135 |
time_t starttime; |
178 | 136 |
|
137 |
if (!FileLoadLogs) return; |
|
138 |
||
1058 | 139 |
if ((roster_gettype(bjid) & ROSTER_TYPE_ROOM) && |
635
d4119cb85aeb
New "load_muc_logs" option
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
140 |
(settings_opt_get_int("load_muc_logs") != 1)) |
d4119cb85aeb
New "load_muc_logs" option
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
141 |
return; |
d4119cb85aeb
New "load_muc_logs" option
Mikael Berthe <mikael@lilotux.net>
parents:
580
diff
changeset
|
142 |
|
178 | 143 |
data = g_new(char, HBB_BLOCKSIZE+32); |
144 |
if (!data) { |
|
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
145 |
scr_LogPrint(LPRINT_LOGNORM, "Not enough memory to read history file"); |
178 | 146 |
return; |
147 |
} |
|
148 |
||
1058 | 149 |
filename = user_histo_file(bjid); |
178 | 150 |
|
151 |
fp = fopen(filename, "r"); |
|
152 |
g_free(filename); |
|
153 |
if (!fp) { g_free(data); return; } |
|
154 |
||
394
4617d0f029ea
Update "large file" size value to 3MB
Mikael Berthe <mikael@lilotux.net>
parents:
378
diff
changeset
|
155 |
// If file is large (> 3MB here), display a message to inform the user |
197 | 156 |
// (it can take a while...) |
157 |
if (!fstat(fileno(fp), &bufstat)) { |
|
394
4617d0f029ea
Update "large file" size value to 3MB
Mikael Berthe <mikael@lilotux.net>
parents:
378
diff
changeset
|
158 |
if (bufstat.st_size > 3145728) |
1058 | 159 |
scr_LogPrint(LPRINT_LOGNORM, "Reading <%s> history file...", bjid); |
197 | 160 |
} |
161 |
||
899
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
162 |
starttime = 0; |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
163 |
if (settings_opt_get_int("max_history_age") > 0) { |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
164 |
int maxdays = settings_opt_get_int("max_history_age"); |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
165 |
time(&starttime); |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
166 |
if (maxdays >= starttime/86400) |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
167 |
starttime = 0; |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
168 |
else |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
169 |
starttime -= maxdays * 86400; |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
170 |
} |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
171 |
|
178 | 172 |
/* See write_histo_line() for line format... */ |
173 |
while (!feof(fp)) { |
|
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
174 |
guint dataoffset = 25; |
259 | 175 |
if (fgets(data, HBB_BLOCKSIZE+27, fp) == NULL) break; |
248 | 176 |
ln++; |
178 | 177 |
|
178 |
for (tail = data; *tail; tail++) ; |
|
179 |
||
180 |
type = data[0]; |
|
181 |
info = data[1]; |
|
241 | 182 |
|
395
3e4f2f98c0bf
Whitespace cleanup (histolog.c)
Mikael Berthe <mikael@lilotux.net>
parents:
394
diff
changeset
|
183 |
if ((type != 'M' && type != 'S') || |
259 | 184 |
((data[11] != 'T') || (data[20] != 'Z') || |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
185 |
(data[21] != ' ') || |
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
186 |
(data[25] != ' ' && data[26] != ' '))) { |
193 | 187 |
if (!err) { |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
188 |
scr_LogPrint(LPRINT_LOGNORM, |
1058 | 189 |
"Error in history file format (%s), l.%u", bjid, ln); |
193 | 190 |
err = 1; |
191 |
} |
|
186 | 192 |
continue; |
178 | 193 |
} |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
194 |
// The number of lines can be written with 3 or 4 bytes. |
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
195 |
if (data[25] != ' ') dataoffset = 26; |
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
196 |
data[21] = data[dataoffset] = 0; |
259 | 197 |
timestamp = from_iso8601(&data[3], 1); |
198 |
len = (guint) atoi(&data[22]); |
|
395
3e4f2f98c0bf
Whitespace cleanup (histolog.c)
Mikael Berthe <mikael@lilotux.net>
parents:
394
diff
changeset
|
199 |
|
178 | 200 |
// Some checks |
201 |
if (((type == 'M') && (info != 'S' && info != 'R')) || |
|
277
4d7040cff8ee
Remove busy/occupied status, which does not really exist
Mikael Berthe <mikael@lilotux.net>
parents:
273
diff
changeset
|
202 |
((type == 'I') && (!strchr("OAIFDN", info)))) { |
193 | 203 |
if (!err) { |
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
204 |
scr_LogPrint(LPRINT_LOGNORM, "Error in history file format (%s), l.%u", |
1058 | 205 |
bjid, ln); |
193 | 206 |
err = 1; |
207 |
} |
|
186 | 208 |
continue; |
178 | 209 |
} |
210 |
||
197 | 211 |
// XXX This will fail when a message is too big |
178 | 212 |
while (len--) { |
248 | 213 |
ln++; |
259 | 214 |
if (fgets(tail, HBB_BLOCKSIZE+27 - (tail-data), fp) == NULL) |
249 | 215 |
break; |
178 | 216 |
|
217 |
while (*tail) tail++; |
|
218 |
} |
|
248 | 219 |
// Small check for too long messages |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
220 |
if (tail >= HBB_BLOCKSIZE+dataoffset+1 + data) { |
249 | 221 |
// Maybe we will have a parse error on next, because this |
222 |
// message is big (maybe too big). |
|
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
223 |
scr_LogPrint(LPRINT_LOGNORM, "A message could be too big " |
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
224 |
"in history file..."); |
248 | 225 |
} |
251 | 226 |
// Remove last CR (we keep it if the line is empty, too) |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
227 |
if ((tail > data+dataoffset+1) && (*(tail-1) == '\n')) |
178 | 228 |
*(tail-1) = 0; |
229 |
||
899
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
230 |
// Check if the data is older than max_history_age |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
231 |
if (starttime) { |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
232 |
if (timestamp > starttime) |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
233 |
starttime = 0; // From now on, load everything |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
234 |
else |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
235 |
continue; |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
236 |
} |
a833f3d6119a
Add option 'max_history_age'
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
237 |
|
178 | 238 |
if (type == 'M') { |
772
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
239 |
char *converted; |
178 | 240 |
if (info == 'S') |
729
39f67cade02c
Use bold font for outgoing messages
Mikael Berthe <mikael@lilotux.net>
parents:
727
diff
changeset
|
241 |
prefix_flags = HBB_PREFIX_OUT | HBB_PREFIX_HLIGHT; |
178 | 242 |
else |
184 | 243 |
prefix_flags = HBB_PREFIX_IN; |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
774
diff
changeset
|
244 |
converted = from_utf8(&data[dataoffset+1]); |
772
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
245 |
if (converted) { |
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
246 |
xtext = ut_expand_tabs(converted); // Expand tabs |
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
247 |
hbuf_add_line(p_buddyhbuf, xtext, timestamp, prefix_flags, width); |
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
248 |
if (xtext != converted) |
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
249 |
g_free(xtext); |
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
250 |
g_free(converted); |
464be13343a9
Store most data in UTF-8 internally
Mikael Berthe <mikael@lilotux.net>
parents:
729
diff
changeset
|
251 |
} |
193 | 252 |
err = 0; |
178 | 253 |
} |
254 |
} |
|
255 |
fclose(fp); |
|
256 |
g_free(data); |
|
257 |
} |
|
258 |
||
110 | 259 |
// hlog_enable() |
260 |
// Enable logging to files. If root_dir is NULL, then $HOME/.mcabber is used. |
|
177 | 261 |
// If loadfiles is TRUE, we will try to load buddies history logs from file. |
281
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
277
diff
changeset
|
262 |
void hlog_enable(guint enable, const char *root_dir, guint loadfiles) |
110 | 263 |
{ |
264 |
UseFileLogging = enable; |
|
177 | 265 |
FileLoadLogs = loadfiles; |
110 | 266 |
|
177 | 267 |
if (enable || loadfiles) { |
110 | 268 |
if (root_dir) { |
269 |
int l = strlen(root_dir); |
|
270 |
if (l < 1) { |
|
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
271 |
scr_LogPrint(LPRINT_LOGNORM, "Error: logging dir name too short"); |
362
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
272 |
UseFileLogging = FileLoadLogs = FALSE; |
110 | 273 |
return; |
274 |
} |
|
275 |
// RootDir must be slash-terminated |
|
276 |
if (root_dir[l-1] == '/') |
|
277 |
RootDir = g_strdup(root_dir); |
|
278 |
else { |
|
279 |
RootDir = g_new(char, l+2); |
|
280 |
strcpy(RootDir, root_dir); |
|
281 |
strcat(RootDir, "/"); |
|
282 |
} |
|
283 |
} else { |
|
284 |
char *home = getenv("HOME"); |
|
169 | 285 |
char *dir = "/.mcabber/histo/"; |
110 | 286 |
RootDir = g_new(char, strlen(home) + strlen(dir) + 1); |
287 |
strcpy(RootDir, home); |
|
288 |
strcat(RootDir, dir); |
|
289 |
} |
|
362
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
290 |
// Check directory permissions (should not be readable by group/others) |
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
291 |
if (checkset_perm(RootDir, TRUE) == -1) { |
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
292 |
// The directory does not actually exists |
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
293 |
g_free(RootDir); |
374
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
294 |
scr_LogPrint(LPRINT_LOGNORM, "ERROR: Cannot access " |
bd5638c21834
Improve logging system (traces)
Mikael Berthe <mikael@lilotux.net>
parents:
366
diff
changeset
|
295 |
"history log directory, logging DISABLED"); |
362
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
296 |
UseFileLogging = FileLoadLogs = FALSE; |
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
297 |
} |
d8f147d6e872
Check directory and config file permissions
Mikael Berthe <mikael@lilotux.net>
parents:
352
diff
changeset
|
298 |
} else { // Disable history logging |
774
46304b773a44
Remove useless checks before g_free() calls
Mikael Berthe <mikael@lilotux.net>
parents:
772
diff
changeset
|
299 |
g_free(RootDir); |
110 | 300 |
} |
301 |
} |
|
302 |
||
1058 | 303 |
inline void hlog_write_message(const char *bjid, time_t timestamp, int sent, |
113 | 304 |
const char *msg) |
305 |
{ |
|
1058 | 306 |
write_histo_line(bjid, timestamp, 'M', ((sent) ? 'S' : 'R'), msg); |
113 | 307 |
} |
308 |
||
1058 | 309 |
inline void hlog_write_status(const char *bjid, time_t timestamp, |
221 | 310 |
enum imstatus status, const char *status_msg) |
113 | 311 |
{ |
312 |
// #1 XXX Check status value? |
|
313 |
// #2 We could add a user-readable comment |
|
1058 | 314 |
write_histo_line(bjid, timestamp, 'S', toupper(imstatus2char[status]), |
221 | 315 |
status_msg); |
113 | 316 |
} |
317 |
||
580 | 318 |
/* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |