+ /* fall back to built-in instant message display */
+ scr_printf("\n");
+ lines_printed++;
+
+ /* Header derived from flags */
+ if (flags & 2)
+ scr_printf("Please log off now, as requested ");
+ else if (flags & 1)
+ scr_printf("Broadcast message ");
+ else if (flags & 4)
+ scr_printf("Chat request ");
+ else
+ scr_printf("Message ");
+
+ /* Timestamp. Can this be improved? */
+ if (stamp.tm_hour == 0 || stamp.tm_hour == 12)/* 12am/12pm */
+ scr_printf("at 12:%02d%cm", stamp.tm_min,
+ stamp.tm_hour ? 'p' : 'a');
+ else if (stamp.tm_hour > 12) /* pm */
+ scr_printf("at %d:%02dpm",
+ stamp.tm_hour - 12, stamp.tm_min);
+ else /* am */
+ scr_printf("at %d:%02dam", stamp.tm_hour, stamp.tm_min);
+
+ /* Sender */
+ scr_printf(" from %s", sender);
+
+ /* Remote node, if any */
+ if (strncmp(ipc_for_signal_handlers->ServInfo.nodename, node, 32))
+ scr_printf(" @%s", node);
+
+ scr_printf(":\n");
+ lines_printed++;
+ fmout(screenwidth, NULL, listing, NULL, 1, screenheight, -1, 0);
+ free(listing);
+
+ /* when running in curses mode, the scroll bar in most
+ xterm-style programs becomes useless, so it makes sense to
+ pause after a screenful of pages if the user has been idle
+ for a while. However, this is annoying to some of the users
+ who aren't in curses mode and tend to leave their clients
+ idle. keepalives become disabled, resulting in getting booted
+ when coming back to the idle session. but they probably have
+ a working scrollback in their terminal, so disable it in this
+ case:
+ */
+ if (!is_curses_enabled())
+ lines_printed = 0;