1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Shows log date when viewing history

This commit is contained in:
James Booth 2012-10-14 17:38:10 +01:00
parent 655430418b
commit b2103b1c0f

View File

@ -116,6 +116,15 @@ chat_log_get_previous(const gchar * const login, gchar *recipient,
char *line = NULL; char *line = NULL;
size_t read = 0; size_t read = 0;
if (logp != NULL) { 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); size_t length = getline(&line, &read, logp);
while (length != -1) { while (length != -1) {
char *copy = malloc(length); char *copy = malloc(length);