Code cleanup
This commit is contained in:
parent
26014af40c
commit
f4df56ab59
@ -1606,6 +1606,8 @@ void BlueWave_Fetch()
|
||||
REQ_REC Req;
|
||||
int i, Found, OLC_head, OLC_filter, OLC_macro, OLC_keyword, HEAD_written;
|
||||
fidoaddr dest;
|
||||
time_t now;
|
||||
struct tm *tm;
|
||||
|
||||
colour(9, 0);
|
||||
/* Processing BlueWave reply packet */
|
||||
@ -1634,6 +1636,7 @@ void BlueWave_Fetch()
|
||||
return;
|
||||
}
|
||||
Syslog('+', "Login %s, Alias %s", Uph.loginname, Uph.aliasname);
|
||||
Syslog('m', "Tear: %s", Uph.reader_tear);
|
||||
/* MORE CHECKS HERE */
|
||||
|
||||
colour(CFG.TextColourF, CFG.TextColourB);
|
||||
@ -1650,7 +1653,10 @@ void BlueWave_Fetch()
|
||||
Syslog('m', " From : %s", Upr.from);
|
||||
Syslog('m', " To : %s", Upr.to);
|
||||
Syslog('m', " Subj : %s", Upr.subj);
|
||||
Syslog('m', " Date : %ld", Upr.unix_date);
|
||||
now = Upr.unix_date;
|
||||
tm = gmtime(&now);
|
||||
Syslog('m', " Date : %02d-%02d-%d %02d:%02d:%02d", tm->tm_mday, tm->tm_mon+1,
|
||||
tm->tm_year+1900, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
Syslog('m', " Dest : %d:%d/%d.%d", Upr.destzone, Upr.destnet, Upr.destnode, Upr.destpoint);
|
||||
if (Upr.msg_attr & UPL_INACTIVE)
|
||||
Syslog('m', " Message is Inactive");
|
||||
@ -1704,7 +1710,6 @@ void BlueWave_Fetch()
|
||||
|
||||
if (Open_Msgbase(msgs.Base, 'w')) {
|
||||
Msg_New();
|
||||
Syslog('m', "Msgbase open and locked");
|
||||
strcpy(Msg.From, Upr.from);
|
||||
strcpy(Msg.To, Upr.to);
|
||||
strcpy(Msg.Subject, Upr.subj);
|
||||
@ -1719,14 +1724,12 @@ void BlueWave_Fetch()
|
||||
dest.net = Upr.destnet;
|
||||
dest.node = Upr.destnode;
|
||||
dest.point = Upr.destpoint;
|
||||
Syslog('m', "Header fields are set, starting kludges");
|
||||
Add_Kludges(dest, FALSE, Upr.filename);
|
||||
Syslog('+', "Msg (%ld) to \"%s\", \"%s\", in %s", Msg.Id, Msg.To, Msg.Subject, msgs.QWKname);
|
||||
sprintf(temp, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, Upr.filename);
|
||||
unlink(temp);
|
||||
i++;
|
||||
Close_Msgbase();
|
||||
Syslog('m', "Msgbase closed again");
|
||||
fseek(mf, - (msgshdr.recsize + msgshdr.syssize), SEEK_CUR);
|
||||
msgs.Posted.total++;
|
||||
msgs.Posted.tweek++;
|
||||
@ -1801,7 +1804,6 @@ void BlueWave_Fetch()
|
||||
/*
|
||||
* Process offline configuration
|
||||
*/
|
||||
|
||||
sprintf(temp, "%s/%s/%s.OLC", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid);
|
||||
if ((iol = fopen(temp, "r")) == NULL) {
|
||||
temp = tl(temp);
|
||||
@ -1819,12 +1821,12 @@ void BlueWave_Fetch()
|
||||
OLC_filter=OLC_macro=OLC_keyword=0;
|
||||
memset(&Pdh,0,sizeof(PDQ_HEADER));
|
||||
Syslog('f', "%s Opened for writing", temp);
|
||||
while(fgets(b,255,iol) != NULL ){
|
||||
while (fgets(b,255,iol) != NULL ){
|
||||
buffer=b;
|
||||
while (isspace(buffer[0]))
|
||||
buffer++;
|
||||
Syslog('m', "Reading: %s ", buffer);
|
||||
if ( ( strncasecmp(buffer,"[Global",7) == 0) && (strlen(buffer) > 22) ){
|
||||
if (( strncasecmp(buffer,"[Global",7) == 0) && (strlen(buffer) > 22) ){
|
||||
OLC_head=TRUE;
|
||||
continue;
|
||||
}else{
|
||||
@ -1841,9 +1843,7 @@ void BlueWave_Fetch()
|
||||
buffer+=11;
|
||||
while (isspace(buffer[0]) || buffer[0]=='=')
|
||||
buffer++;
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0)
|
||||
|| (strncasecmp(buffer,"YES",3)==0)
|
||||
|| (strncasecmp(buffer,"ON",2)==0))
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0))
|
||||
Pdh.flags |= PDQ_AREA_CHANGES;
|
||||
continue;
|
||||
}
|
||||
@ -1851,9 +1851,7 @@ void BlueWave_Fetch()
|
||||
buffer+=11;
|
||||
while (isspace(buffer[0]) || buffer[0]=='=')
|
||||
buffer++;
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0)
|
||||
|| (strncasecmp(buffer,"YES",3)==0)
|
||||
|| (strncasecmp(buffer,"ON",2)==0))
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0))
|
||||
Pdh.flags |= PDQ_HOTKEYS;
|
||||
continue;
|
||||
}
|
||||
@ -1861,9 +1859,7 @@ void BlueWave_Fetch()
|
||||
buffer+=11;
|
||||
while (isspace(buffer[0]) || buffer[0]=='=')
|
||||
buffer++;
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0)
|
||||
|| (strncasecmp(buffer,"YES",3)==0)
|
||||
|| (strncasecmp(buffer,"ON",2)==0))
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0))
|
||||
Pdh.flags |= PDQ_XPERT;
|
||||
continue;
|
||||
}
|
||||
@ -1871,9 +1867,7 @@ void BlueWave_Fetch()
|
||||
buffer+=12;
|
||||
while (isspace(buffer[0]) || buffer[0]=='=')
|
||||
buffer++;
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0)
|
||||
|| (strncasecmp(buffer,"YES",3)==0)
|
||||
|| (strncasecmp(buffer,"ON",2)==0))
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0))
|
||||
Pdh.flags |= PDQ_NOT_MY_MAIL;
|
||||
continue;
|
||||
}
|
||||
@ -1881,9 +1875,7 @@ void BlueWave_Fetch()
|
||||
buffer+=12;
|
||||
while (isspace(buffer[0]) || buffer[0]=='=')
|
||||
buffer++;
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0)
|
||||
|| (strncasecmp(buffer,"YES",3)==0)
|
||||
|| (strncasecmp(buffer,"ON",2)==0))
|
||||
if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0))
|
||||
Pdh.flags |= PDQ_GRAPHICS;
|
||||
continue;
|
||||
}
|
||||
@ -1937,8 +1929,7 @@ void BlueWave_Fetch()
|
||||
buffer+=4;
|
||||
while (isspace(buffer[0]) || buffer[0]=='=')
|
||||
buffer++;
|
||||
if ((strncasecmp(buffer,"All",3)==0)
|
||||
|| (strncasecmp(buffer,"Pers",4)==0)){
|
||||
if ((strncasecmp(buffer,"All",3)==0) || (strncasecmp(buffer,"Pers",4)==0)){
|
||||
if ( HEAD_written == FALSE ){
|
||||
fwrite(&Pdh,sizeof(PDQ_HEADER),1,tp);
|
||||
Syslog('m', "Writting PDQ header...");
|
||||
@ -1953,7 +1944,7 @@ void BlueWave_Fetch()
|
||||
}
|
||||
}
|
||||
fclose(tp);
|
||||
}else{
|
||||
} else {
|
||||
WriteError("Unable to convert .OLC file to %s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid);
|
||||
Syslog('?', "Unable to convert .OLC file to %s/%s/%s.PDQ",CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid);
|
||||
}
|
||||
@ -1963,6 +1954,7 @@ void BlueWave_Fetch()
|
||||
temp = tl(temp);
|
||||
unlink(temp);
|
||||
}
|
||||
|
||||
sprintf(temp, "%s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid);
|
||||
if ((tp = fopen(temp, "r")) == NULL) {
|
||||
temp = tl(temp);
|
||||
|
Reference in New Issue
Block a user