--- sbbs/src/sbbs3/putmsg.cpp 2018/04/24 16:41:24 1.1.1.1 +++ sbbs/src/sbbs3/putmsg.cpp 2018/04/24 16:43:54 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet message/menu display routine */ -/* $Id: putmsg.cpp,v 1.1.1.1 2018/04/24 16:41:24 root Exp $ */ +/* $Id: putmsg.cpp,v 1.1.1.2 2018/04/24 16:43:54 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -47,13 +47,13 @@ /* the attributes prior to diplaying the message are always restored. */ /* Ignores Ctrl-Z's */ /****************************************************************************/ -char sbbs_t::putmsg(char *str, long mode) +char sbbs_t::putmsg(const char *str, long mode) { char tmpatr,tmp2[256],tmp3[128]; uchar exatr=0; int orgcon=console,i; ulong l=0,sys_status_sav=sys_status; - long col=0; + int defered_pause=FALSE; attr_sp=0; /* clear any saved attributes */ tmpatr=curatr; /* was lclatr(-1) */ @@ -68,11 +68,11 @@ char sbbs_t::putmsg(char *str, long mode if(str[l+1]=='"' && !(sys_status&SS_NEST_PF)) { /* Quote a file */ l+=2; i=0; - while(i<12 && isprint(str[l]) && str[l]!='\\' && str[l]!='/') + while(i=16) { /* setting background */ @@ -167,14 +167,14 @@ char sbbs_t::putmsg(char *str, long mode case 'W': attr((curatr&0xf0)|LIGHTGRAY|HIGH); break; - case 'S': /* swap foreground and background */ + case 'S': /* swap foreground and background - TODO: This sets foreground to BLACK! */ attr((curatr&0x07)<<4); break; } exatr=1; l+=2; /* Skip |x */ } /* Skip second digit if it exists */ - else if(cfg.sys_misc&SM_WWIV && str[l]==CTRL_C && isdigit(str[l+1])) { + else if(cfg.sys_misc&SM_WWIV && str[l]==CTRL_C && isdigit((unsigned char)str[l+1])) { exatr=1; switch(str[l+1]) { default: @@ -233,6 +233,19 @@ char sbbs_t::putmsg(char *str, long mode if(str[l]==ESC && str[l+1]=='$') /* WIP command */ lncntr=0; if(str[l]=='@' && !(mode&P_NOATCODES)) { + /* In HTML mode, defer PAUSE and MORE to end and supress message */ + if(mode&P_HTML) { + if(!memcmp(str+l,"@MORE@",6)) { + defered_pause=TRUE; + l+=6; + continue; + } + if(!memcmp(str+l,"@PAUSE@",7)) { + defered_pause=TRUE; + l+=7; + continue; + } + } i=show_atcode((char *)str+l); /* returns 0 if not valid @ code */ l+=i; /* i is length of code string */ if(i) /* if valid string, go to top */ @@ -240,22 +253,33 @@ char sbbs_t::putmsg(char *str, long mode } if(str[l]!=CTRL_Z) { outchar(str[l]); - if(!exatr && !outchar_esc && lncntr && lbuflen && cols && ++col==cols) +#if 0 + if(!(mode&P_HTML) && !exatr && !outchar_esc && lncntr && lbuflen && cols && ++col==cols) lncntr++; else col=0; +#endif } l++; } } + if(mode&P_HTML) + putcom("\x02"); if(!(mode&P_SAVEATR)) { console=orgcon; attr(tmpatr); } - if(mode&P_HTML) - putcom("\x02"); attr_sp=0; /* clear any saved attributes */ + + /* Handle defered pauses */ + if(defered_pause) { + if(mode&P_HTML) + getkey(0); + else + pause(); + } + /* Restore original settings of Forced Pause On/Off */ sys_status&=~(SS_PAUSEOFF|SS_PAUSEON); sys_status|=(sys_status_sav&(SS_PAUSEOFF|SS_PAUSEON));