about summary refs log tree commit diff stats
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 92db25fa..9db4f854 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -922,14 +922,14 @@ win_show_status_string(ProfWin *window, const char * const from,
 }
 
 void
-win_print_incoming_message(ProfWin *window, GTimeVal *tv_stamp,
+win_print_incoming_message(ProfWin *window, GDateTime *timestamp,
     const char * const from, const char * const message)
 {
     switch (window->type)
     {
         case WIN_CHAT:
         case WIN_PRIVATE:
-            win_print(window, '-', tv_stamp, NO_ME, THEME_TEXT_THEM, from, message);
+            win_print(window, '-', timestamp, NO_ME, THEME_TEXT_THEM, from, message);
             break;
         default:
             assert(FALSE);
@@ -938,31 +938,25 @@ win_print_incoming_message(ProfWin *window, GTimeVal *tv_stamp,
 }
 
 void
-win_vprint(ProfWin *window, const char show_char, GTimeVal *tstamp,
+win_vprint(ProfWin *window, const char show_char, GDateTime *timestamp,
     int flags, theme_item_t theme_item, const char * const from, const char * const message, ...)
 {
     va_list arg;
     va_start(arg, message);
     GString *fmt_msg = g_string_new(NULL);
     g_string_vprintf(fmt_msg, message, arg);
-    win_print(window, show_char, tstamp, flags, theme_item, from, fmt_msg->str);
+    win_print(window, show_char, timestamp, flags, theme_item, from, fmt_msg->str);
     g_string_free(fmt_msg, TRUE);
 }
 
 void
-win_print(ProfWin *window, const char show_char, GTimeVal *tstamp,
+win_print(ProfWin *window, const char show_char, GDateTime *timestamp,
     int flags, theme_item_t theme_item, const char * const from, const char * const message)
 {
-    GDateTime *time;
-
-    if (tstamp == NULL) {
-        time = g_date_time_new_now_local();
-    } else {
-        time = g_date_time_new_from_timeval_utc(tstamp);
-    }
+    if (timestamp == NULL) timestamp = g_date_time_new_now_local();
 
-    buffer_push(window->layout->buffer, show_char, time, flags, theme_item, from, message, NULL);
-    _win_print(window, show_char, time, flags, theme_item, from, message, NULL);
+    buffer_push(window->layout->buffer, show_char, timestamp, flags, theme_item, from, message, NULL);
+    _win_print(window, show_char, timestamp, flags, theme_item, from, message, NULL);
     // TODO: cross-reference.. this should be replaced by a real event-based system
     ui_input_nonblocking(TRUE);
 }