# HG changeset patch # User Mikael Berthe # Date 1147124802 -7200 # Node ID d0781ca2dd08209d9d72608e14a33f39fb95dd28 # Parent 42c43a88d8238dcaad51c802a47d76868665e1c3 Use new status buffer window Update scr_LogPrint() to use the new status buffer. Introduce HBB_PREFIX_SPECIAL flag which changes the prefix field in the special buffers. diff -r 42c43a88d823 -r d0781ca2dd08 mcabber/src/hbuf.c --- a/mcabber/src/hbuf.c Mon May 08 23:46:18 2006 +0200 +++ b/mcabber/src/hbuf.c Mon May 08 23:46:42 2006 +0200 @@ -38,7 +38,7 @@ // (for ex. when HBB_FLAG_PERSISTENT is set). struct { // hbuf_line_info time_t timestamp; - guchar flags; + guint flags; } prefix; } hbuf_block; diff -r 42c43a88d823 -r d0781ca2dd08 mcabber/src/hbuf.h --- a/mcabber/src/hbuf.h Mon May 08 23:46:18 2006 +0200 +++ b/mcabber/src/hbuf.h Mon May 08 23:46:42 2006 +0200 @@ -23,10 +23,11 @@ #define HBB_PREFIX_NOFLAG 64 #define HBB_PREFIX_HLIGHT 128 #define HBB_PREFIX_NONE 256 +#define HBB_PREFIX_SPECIAL 512 typedef struct { time_t timestamp; - guchar flags; + guint flags; char *text; } hbb_line; diff -r 42c43a88d823 -r d0781ca2dd08 mcabber/src/screen.c --- a/mcabber/src/screen.c Mon May 08 23:46:18 2006 +0200 +++ b/mcabber/src/screen.c Mon May 08 23:46:42 2006 +0200 @@ -101,6 +101,9 @@ GSList *keyseqlist; static void add_keyseq(char *seqstr, guint mkeycode, gint value); +void scr_WriteInWindow(const char *winId, const char *text, time_t timestamp, + unsigned int prefix_flags, int force_show); + /* Functions */ @@ -357,9 +360,18 @@ else buffer_locale = buffer; if (Curses) { + char *buf_specialwindow; wprintw(logWnd, "\n%s", buffer_locale); update_panels(); doupdate(); + if (flag & LPRINT_NOTUTF8) + buf_specialwindow = to_utf8(b2); + else + buf_specialwindow = b2; + scr_WriteInWindow(NULL, buf_specialwindow, timestamp, + HBB_PREFIX_SPECIAL, FALSE); + if (buf_specialwindow != b2) + g_free(buf_specialwindow); } else { printf("%s\n", buffer_locale); } @@ -460,7 +472,7 @@ int width; hbb_line **lines, *line; GList *hbuf_head; - char date[32]; + char date[64]; width = scr_WindowWidth(win_entry->win); @@ -502,7 +514,7 @@ if (line->flags & HBB_PREFIX_HLIGHT) wattrset(win_entry->win, get_color(COLOR_MSGOUT)); - if (line->timestamp) { + if (line->timestamp && !(line->flags & HBB_PREFIX_SPECIAL)) { strftime(date, 30, "%m-%d %H:%M", localtime(&line->timestamp)); } else strcpy(date, " "); @@ -524,6 +536,9 @@ wprintw(win_entry->win, "%.11s <== ", date); } else if (line->flags & HBB_PREFIX_OUT) { wprintw(win_entry->win, "%.11s --> ", date); + } else if (line->flags & HBB_PREFIX_SPECIAL) { + strftime(date, 30, "%m-%d %H:%M:%S", localtime(&line->timestamp)); + wprintw(win_entry->win, "%.14s ", date); } else { wprintw(win_entry->win, "%.11s ", date); } @@ -613,7 +628,7 @@ // Lines are splitted when they are too long to fit in the chat window. // If this window doesn't exist, it is created. void scr_WriteInWindow(const char *winId, const char *text, time_t timestamp, - unsigned int prefix_flags, int force_show) + unsigned int prefix_flags, int force_show) { winbuf *win_entry; char *text_locale;