2TFC024.422 1Scan And Validate Pending Messages The Flying Chicken [SysOp] #1 @12456 3Friday, March 19, 1993 1 5:54 pm TFC024.422 - Unvalidated Message Scan for SysOps Author: The Flying Chicken 1@12456 (WWIVLink) 1@2456 (WWIVNet) Source: WWIV 4.20e/WWIV 4.22 Version: 2.0 NOTE: This file is for WWIV 4.22 ONLY. If you use 4.20e, e-mail me for the previous version of this mod. Okay folks. This mod is probably one of the most asked-for mods in existence, and I can't believe I've never seen anyone do it before me. I tried once, and got lost in the endlessly confusing code Wayne used in MSGBASE.C and MSGBASE1.C. However, I think I have finally mastered the beast, and am ready to conquer the mod. This mod will scan your messages bases for all NEW messages that need to be validated (because of your user restrictions) or need to be network validated (if you have the validation option set in //BOARDEDIT). It works in much the same way as the 'N', 'Q', and '/N' message scanning commands. To scan your bases, simply type one of the following: J - Will ask if you want to scan all message bases or not. If so, all bases will be scanned. Otherwise, only the current base is scanned. /J - Scans from the current message base to the last. The /J command is a twin of the /N command. The J (Scan all) is a twin of the N command. The J (DON'T scan all) is a twin of the Q command. When scanning, only messages needing to be validated will be displayed. You can perform any function you could normally perform while reading new messages. If a message needs to be validated, but has already by read by you, the /J or J command won't pick the message up. This is because it starts scanning where a 'N' (New-Scan) would start. You really don't want to scan thru every message on each base, believe me. Don't bother trying to figure out why 'J', it was about the only letter left. (grin) One final note (and feature, I think) about the mod. It will not affect your qscan pointers. If I didn't do this, your qscan pointer would point to the last message you validated, instead of the last message you read, so you'd "lose" messages. This way, you can validate as many times as you want, and still go back and do an effective N-Scan later on. I wrote this mod for my 4.20 source, and have no idea if it works or not in 4.12. However, other than the fact that Wayne now uses the 64 subs mod, the code shouldn't have changed that much between the two versions, so it might work okay. If you have 4.12, and have problems with the mod, holler, and I'll be glad to help you out. v2.0 - Upgrade for 4.22 v1.0 - Initial version Before using this or any mod, back up your source !!!!! And while your at it, BACK UP YOUR BBS!!!!!! (or at least the important stuff!) PKZIP source *.c *.h *.mak 1. Load up MSGBASE1.C. Search for the void scan() function, and makes these changes at the beginning of the function. void scan(int msgnum, int optype, int *nextsub) { char s[81],s1[81],s2[81],*b,*ss1; int i,i1,i2,done,quit,abort,next,val,realexpress; slrec ss; long l,len; postrec p,p1; int vscan=0; /* ADD */ if (optype==3) /* ADD */ vscan=1; /* ADD */ irt[0]=0; irt_name[0]=0; 2. Scroll down a bit.... if (s[0]==0) { i=msgnum+1; if (i>=nummsgs+1) done=1; } if ((i!=0) && (i<=nummsgs) && (i>=1)) { optype=2; if (vscan) /* ADD */ optype=3; /* ADD */ msgnum=i; } else if (s[1]==0) { switch(s[0]) { case 'Q': quit=1; done=1; 3. Go to step 4 4. And down a bit more... case '-': if ((msgnum>1) && (msgnum-10) && (msgnum<=nummsgs)) read_message(msgnum,&next,&val); if (optype==3) /* ADD */ if ((msgnum>0) && (msgnum<=nummsgs) && /* ADD */ (msg[msgnum].status & (status_unvalidated | status_pending_net))) read_message(msgnum,&next,&val); /* ADD THIS AND ABOVE LINE */ else /* ADD */ next=1; /* ADD */ ansic(0); nl(); if (next) { if (optype==3) /* ADD */ while ((msgnum<=nummsgs) && (!(msgs[msgnum].status & /* ADD */ (status_unvalidated | status_pending_net)))) /* ADD */ ++msgnum; else /* ADD */ ++msgnum; /* ADD */ if (msgnum>nummsgs) done=1; optype=2; if (vscan) /* ADD */ optype=3; /* ADD */ } else optype=0; if (expressabort) if (realexpress) { done=1; quit=1; *nextsub=0; } else { expressabort=0; express=0; optype=0; } break; } } while ((!done) && (!hangup)); if (!realexpress) { express=0; expressabort=0; } 6. Search for the nscan() function, and add the following two functions right before it. void vscan(int bn, int *ns) /* ADD FUNCTION */ { int i,nextsub,os,sn,done=0; char s[81],s1[81]; unsigned long qscnptrx; sn=usub[bn].subnum; if ((hangup) || (sn<0)) return; nl(); qscnptrx=qsc_p[sn]; nextsub=*ns; os=cursub; cursub=bn; i=1; iscan(cursub); sprintf(s,"< V-Scan %s %s - %u %s >", subboards[curlsub].name, usub[cursub].keys,nummsgs, "msgs"); prt(1,s); nl(); while ((i<=nummsgs) && (!done)) if (msgs[i].status & (status_unvalidated | status_pending_net)) done=1; else ++i; if ((nummsgs>0) && (i<=nummsgs)) scan(i,3,&nextsub); cursub=os; *ns=nextsub; qsc_p[sn]=qscnptrx; } void val_scan(int ss,int all) /* ADD FUNCTION */ { int i,nextsub,abort,next; nl(); nextsub=1; if (all) { prt(3,"<< Val-Scan All >>"); nl(); } for (i=ss; (usub[i].subnum!=-1) && (i>"); nl(); nl(); } } 7. Save MSGBASE1.C and load up BBS.C. Search for void mainmenu() and scroll down farther. Make the changes as shown. if (strcmp(s,"/E")==0) slash_e(); if ((strcmp(s,"/J")==0) && (lcs())) /* MOD - ADD */ val_scan(cursub,1); /* MOD - ADD */ if (strcmp(s,"/N")==0) nscan(cursub); 8. Search down and make these changes. case 'J': /* MOD - ADD */ if (lcs()) { /* MOD - ADD */ express=0; /* MOD - ADD */ expressabort=0; /* MOD - ADD */ prt(2,"Scan all message bases?"); /* MOD - ADD */ if (yn()) /* MOD - ADD */ val_scan(0,1); /* MOD - ADD */ else { /* MOD - ADD */ i=0; /* MOD - ADD */ vscan(cursub,&i); /* MOD - ADD */ } /* MOD - ADD */ } /* MOD - ADD */ break; /* MOD - ADD */ case 'N': express=0; expressabort=0; nscan(0); break; 9. Save BBS.C and load up FCNS.H. Search for /*File: msgbase1.c*/ and make these changes... void scan(int msgnum, int optype, int *nextsub); void qscan(int bn, int *ns); void nscan(int ss); void vscan(int bn, int *ns); /* MOD - ADD */ void val_scan(int ss); /* MOD - ADD */ void scan2(); 10. Make sure and add the 'J' and '/J' commands to your menu files, menu number 0 & 5, I believe... DISCLAIMER: I make no guarantees with this mod whatsoever. Your installation of the mod is your acceptance of any damages caused to your hardware or software, incendental or otherwise. PLEASE REPORT ALL BUGS!