about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-14 17:38:10 +0100
committerJames Booth <boothj5@gmail.com>2012-10-14 17:38:10 +0100
commitb2103b1c0fba54f6e65ce290505309836cbf543f (patch)
tree2569ba56cc44414d237f480c9c31b2eb77f95f48 /src
parent655430418b354499e95c5f06dc9b05fe67c76028 (diff)
downloadprofani-tty-b2103b1c0fba54f6e65ce290505309836cbf543f.tar.gz
Shows log date when viewing history
Diffstat (limited to 'src')
-rw-r--r--src/chat_log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/chat_log.c b/src/chat_log.c
index ce044aaf..ea3df7ef 100644
--- a/src/chat_log.c
+++ b/src/chat_log.c
@@ -116,6 +116,15 @@ chat_log_get_previous(const gchar * const login, gchar *recipient,
         char *line = NULL;
         size_t read = 0;
         if (logp != NULL) {
+            GString *gs_header = g_string_new("Log ");
+            g_string_append_printf(gs_header, "%d/%d/%d:",
+                g_date_time_get_day_of_month(log_date),
+                g_date_time_get_month(log_date),
+                g_date_time_get_year(log_date));
+            char *header = strdup(gs_header->str);
+            history = g_slist_append(history, header);
+            g_string_free(gs_header, TRUE);
+
             size_t length = getline(&line, &read, logp);
             while (length != -1) {
                 char *copy = malloc(length);