about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/chat_log.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/chat_log.c b/src/chat_log.c
index 3e685a96..89681924 100644
--- a/src/chat_log.c
+++ b/src/chat_log.c
@@ -25,26 +25,27 @@
 
 #include "glib.h"
 
-#include "log.h"
+#include "chat_log.h"
 #include "common.h"
 
 static FILE *chatlog;
 
-void chat_log_chat(const char * const user, const char * const msg)
-{
-    fprintf(chatlog, "%s: %s\n", user, msg);
-}
-
 void chat_log_init(void)
 {
     GString *log_file = g_string_new(getenv("HOME"));
     g_string_append(log_file, "/.profanity/log");
     create_dir(log_file->str);
     g_string_append(log_file, "/chat.log");
-    logp = fopen(log_file->str, "a");
+    chatlog = fopen(log_file->str, "a");
     g_string_free(log_file, TRUE);
 }
 
+void chat_log_chat(const char * const user, const char * const msg)
+{
+    fprintf(chatlog, "%s: %s\n", user, msg);
+    fflush(chatlog);
+}
+
 void chat_log_close(void)
 {
     fclose(chatlog);