about summary refs log tree commit diff stats
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-10-15 20:55:45 +0100
committerJames Booth <boothj5@gmail.com>2016-10-15 20:55:45 +0100
commitc814cb44b8dafc04baf402cad7f7be165aa1ce6b (patch)
treeb26616b8e336de0010951650c4a3ea46a565d1a8 /src/ui/window.c
parentf761d403b3ba72595c8fb0328822b9cacd3aac9c (diff)
downloadprofani-tty-c814cb44b8dafc04baf402cad7f7be165aa1ce6b.tar.gz
Add win_print_history
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 07dcc9dc..1b456768 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1029,6 +1029,26 @@ win_print_outgoing(ProfWin *window, const char ch, const char *const message, ..
 }
 
 void
+win_print_history(ProfWin *window, GDateTime *timestamp, const char *const message, ...)
+{
+    g_date_time_ref(timestamp);
+
+    va_list arg;
+    va_start(arg, message);
+    GString *fmt_msg = g_string_new(NULL);
+    g_string_vprintf(fmt_msg, message, arg);
+
+    buffer_push(window->layout->buffer, '-', 0, timestamp, NO_COLOUR_DATE, THEME_DEFAULT, "", fmt_msg->str, NULL);
+
+    _win_print(window, '-', 0, timestamp, NO_COLOUR_DATE, THEME_DEFAULT, "", fmt_msg->str, NULL);
+    inp_nonblocking(TRUE);
+    g_date_time_unref(timestamp);
+
+    g_string_free(fmt_msg, TRUE);
+    va_end(arg);
+}
+
+void
 win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp,
     int flags, theme_item_t theme_item, const char *const from, const char *const message, ...)
 {