# HG changeset patch # User mikael # Date 1115326250 0 # Node ID 888ad9f15346cf05c29091dd50b3c2d1b36974cf # Parent e8e447a0764141fe35eec04f5db6b344b7af78c3 [/trunk] Changeset 198 by mikael * Use lowercase jid for history log files * Workaround a problem when loading a history file big a (too) big message * Increase HBB_BLOCKSIZE to 4096 diff -r e8e447a07641 -r 888ad9f15346 mcabber/src/TODO --- a/mcabber/src/TODO Thu May 05 20:05:39 2005 +0000 +++ b/mcabber/src/TODO Thu May 05 20:50:50 2005 +0000 @@ -17,7 +17,6 @@ top variable on a resize). * Show number of online contacts in folded groups * Add a cfg_read_int() function -* Better prefix usage in the hbuf buffers (use flags for IN/OUT etc.) * Buddy buffer in full width (handy for cut'n paste!) * Commands! :-) @@ -42,7 +41,6 @@ - /help * Multi-lines * Handle message type "error" -* Shortcut to jump to next message received (shift-tab?) * File transfer? :) * Conferences :)) * Show status changes in buddy window (if open)? Could be great! diff -r e8e447a07641 -r 888ad9f15346 mcabber/src/hbuf.h --- a/mcabber/src/hbuf.h Thu May 05 20:05:39 2005 +0000 +++ b/mcabber/src/hbuf.h Thu May 05 20:50:50 2005 +0000 @@ -6,7 +6,7 @@ // With current implementation a message must fit in a hbuf block, // so we shouldn't choose a too small size. -#define HBB_BLOCKSIZE 2048 // > 20 please +#define HBB_BLOCKSIZE 4096 // > 20 please // Flags: // - ALLOC: the ptr data has been allocated, it can be freed diff -r e8e447a07641 -r 888ad9f15346 mcabber/src/histolog.c --- a/mcabber/src/histolog.c Thu May 05 20:05:39 2005 +0000 +++ b/mcabber/src/histolog.c Thu May 05 20:50:50 2005 +0000 @@ -43,11 +43,17 @@ static char *user_histo_file(const char *jid) { char *filename; + char *lowerid, *p; if (!UseFileLogging && !FileLoadLogs) return NULL; + lowerid = g_strdup(jid); + for (p=lowerid; *p ; p++) + *p = tolower(*p); + filename = g_new(char, strlen(RootDir) + strlen(jid) + 1); strcpy(filename, RootDir); - strcat(filename, jid); + strcat(filename, lowerid); + g_free(lowerid); return filename; } @@ -133,7 +139,8 @@ if ((type != 'M' && type != 'S') || (data[13] != ' ') || (data[17] != ' ')) { scr_LogPrint("Error in history file format"); - break; + //break; + continue; } data[13] = data[17] = 0; timestamp = (unsigned long) atol(&data[3]); @@ -143,9 +150,11 @@ if (((type == 'M') && (info != 'S' && info != 'R')) || ((type == 'I') && (!strchr("OAIFDCN", info)))) { scr_LogPrint("Error in history file format"); - break; + //break; + continue; } + // FIXME This will fail when a message is too big while (len--) { if (fgets(tail, HBB_BLOCKSIZE+24 - (tail-data), fp) == NULL) break;