diff --git a/src/sbbs3/umonitor/chat.c b/src/sbbs3/umonitor/chat.c index 6ca2a087a28256e3166ae887fd9433f256cf3412..3465fc1db3dcf16434f940c6025f5a2f1fc069cf 100644 --- a/src/sbbs3/umonitor/chat.c +++ b/src/sbbs3/umonitor/chat.c @@ -92,8 +92,8 @@ void drawchatwin(WINDOW **uwin, WINDOW **swin, box_t *boxch) { endwin(); getmaxyx(stdscr,maxy,maxx); - *uwin=newwin(maxy/2,maxx,0,0); - *swin=newwin(0,maxx,maxy/2,0); + *uwin=newwin(maxy/2-1,maxx,1,0); + *swin=newwin(maxy-maxy/2-1,maxx,maxy/2,0); wsetcolor(*uwin,YELLOW,BLUE); wclear(*uwin); wborder(*uwin, boxch->ls, boxch->rs, boxch->ts, boxch->bs, boxch->tl, boxch->tr, boxch->bl, boxch->br); @@ -167,7 +167,7 @@ int chatchar(WINDOW *win, int ch, box_t *boxch) { return(0); } -int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch) { +int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch, void(*timecallback)(void)) { WINDOW *uwin; WINDOW *swin; int in,out; @@ -211,6 +211,8 @@ int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch) { togglechat(cfg,nodenum,node,TRUE); while(in != -1) { + if(timecallback != NULL) + timecallback(); utime(outpath,NULL); utime(inpath,NULL); diff --git a/src/sbbs3/umonitor/chat.h b/src/sbbs3/umonitor/chat.h index 1fae638d4bb4a20af766355a37edd296cc1322f7..4abcfa8cd14e41fe8536b8d0f1fc1643a99aabc0 100644 --- a/src/sbbs3/umonitor/chat.h +++ b/src/sbbs3/umonitor/chat.h @@ -41,4 +41,5 @@ typedef struct { chtype ls, rs, ts, bs, tl, tr, bl, br; } box_t; -int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch); +int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch, void(*timecallback)(void)); + diff --git a/src/sbbs3/umonitor/umonitor.c b/src/sbbs3/umonitor/umonitor.c index 140e9921cc2b66607df9e205a6b6b5984d0b0819..a443c5b144d8e2abc94391d1178d1622c643b14f 100644 --- a/src/sbbs3/umonitor/umonitor.c +++ b/src/sbbs3/umonitor/umonitor.c @@ -412,7 +412,7 @@ int main(int argc, char** argv) { if((j=getnodedat(&cfg,i,&node,NULL))) sprintf(mopt[i-1],"Error reading node data (%d)!",j); else - nodestatus(&cfg,&node,mopt[i-1],72); + sprintf(mopt[i-1],"%3d: %s",i,nodestatus(&cfg,&node,str,71)); } mopt[i-1][0]=0; @@ -467,7 +467,7 @@ int main(int argc, char** argv) { continue; } if((node.status&NODE_INUSE) && node.useron) - chat(&cfg,main_dflt+1,&node,&boxch); + chat(&cfg,main_dflt+1,&node,&boxch,uifc.timedisplay); continue; } @@ -577,7 +577,7 @@ int main(int argc, char** argv) { break; case 4: - chat(&cfg,main_dflt+1,&node,&boxch); + chat(&cfg,main_dflt+1,&node,&boxch,uifc.timedisplay); break; case -1: diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index acfe3232325c770c7b70f07c38a8dd1b2a51b315..a52b9b43a21f8aad11cb446c3e57ad84aee6afd5 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -356,6 +356,12 @@ typedef struct { /****************************************************************************/ void (*showbuf)(char *buf, char *title, BOOL markup); +/****************************************************************************/ +/* Updates time in upper left corner of screen with current time in ASCII/ */ +/* Unix format */ +/****************************************************************************/ + void (*timedisplay)(void); + #endif } uifcapi_t; diff --git a/src/uifc/uifcc.c b/src/uifc/uifcc.c index 9821d0ac8f0297fb1bfc066751144c600f5e6454..c8382ef408a96b91a138689f922e8c2c72a59028 100644 --- a/src/uifc/uifcc.c +++ b/src/uifc/uifcc.c @@ -121,6 +121,7 @@ static int cprintf(char *fmat, ...); static void cputs(char *str); static void gotoxy(int x, int y); static void _putch(unsigned char ch, BOOL refresh); +static void timedisplay(void); #define putch(x) _putch(x,TRUE) /* API routines */ @@ -184,6 +185,7 @@ int uifcinic(uifcapi_t* uifcapi) #ifdef __unix__ api->showhelp=help; api->showbuf=showbuf; + api->timedisplay=timedisplay; #endif #if defined(LOCALE)