mcabber/src/histolog.c
changeset 186 888ad9f15346
parent 184 b5aa2b9c425a
child 193 5cbdcccfab29
--- 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;