Fixed the area/filemgr responses

This commit is contained in:
Michiel Broek 2002-03-31 21:33:16 +00:00
parent 742d84c9d4
commit f24dbddcdb
4 changed files with 18 additions and 10 deletions

Binary file not shown.

View File

@ -906,7 +906,7 @@ void A_Pause(faddr *t, int Pause, FILE *tmp)
fwrite(&Sys, sizeof(Sys), 1, mp);
Syslog('+', "AreaMgr: %s area %s", Pause?"Pause":"Resume", msgs.Tag);
MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr");
MacroVars("RABCDE", "ssssss","OK_PAUSE",msgs.Tag,ascfnode(t, 0x1f),"","");
MacroVars("RABCDE", "ssdsss","OK_PAUSE",msgs.Tag,Pause,"","","");
MsgResult("areamgr.responses",tmp);
a_list = TRUE;
}
@ -1088,6 +1088,7 @@ int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla
if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", subject, replyid)) != NULL) {
MacroVars("RABCDE", "ssssss","WELLCOME","","","","","");
MsgResult("areamgr.responses",np);
fprintf(np, "\r");
fseek(tmp, 0, SEEK_SET);
while ((fgets(Buf, 2048, tmp)) != NULL) {
@ -1095,11 +1096,11 @@ int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla
Buf[strlen(Buf) - 1] = '\0';
}
fprintf(np, "%s\r", Buf);
Syslog('m', "Rep: %s", Buf);
}
fprintf(np, "\r");
MacroVars("RABCDE", "ssssss","GOODBYE","","","","","");
MsgResult("areamgr.responses",np);
fprintf(np, "%s\r", TearLine());
fprintf(np, "\r%s\r", TearLine());
CloseMail(np, t);
} else
WriteError("Can't create netmail");

View File

@ -698,7 +698,7 @@ void F_Pause(faddr *t, int Pause, FILE *tmp)
fwrite(&Sys, sizeof(Sys), 1, fp);
Syslog('+', "FileMgr: %s area %s", Pause?"Pause":"Resume", tic.Name);
MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"FileMgr");
MacroVars("RABCDE", "ssssss","OK_PAUSE",tic.Name,ascfnode(t, 0x1f),"","");
MacroVars("RABCDE", "ssdsss","OK_PAUSE",tic.Name,Pause,"","","");
MsgResult("filemgr.responses",tmp);
f_list = TRUE;
}
@ -887,6 +887,7 @@ int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla
if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", subject, replyid)) != NULL) {
MacroVars("RABCDE", "ssssss","WELLCOME","","","","","");
MsgResult("filemgr.responses",np);
fprintf(np, "\r");
fseek(tmp, 0, SEEK_SET);
while ((fgets(Buf, 2048, tmp)) != NULL) {
@ -894,12 +895,12 @@ int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla
Buf[strlen(Buf) - 1] = '\0';
}
fprintf(np, "%s\r", Buf);
Syslog('m', "Rep: %s", Buf);
}
fprintf(np, "\r");
MacroVars("RABCDE", "ssssss","GOODBYE","","","","","");
MsgResult("filemgr.responses",np);
fprintf(np, "%s\r", TearLine());
fprintf(np, "\r%s\r", TearLine());
CloseMail(np, t);
} else
WriteError("Can't create netmail");

View File

@ -270,7 +270,7 @@ void MgrNotify(faddr *t, char *Buf, FILE *tmp, int mgr)
SearchNodeFaddr(t);
Syslog('+', "XxxxMgr: Notify %s", nodes.Notify?"Yes":"No");
MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,mgr?(char *)"Filemgr":(char *)"Areamgr");
MacroVars("RABCDE", "ssssss",(char *)"OK_PASS",nodes.Apasswd,(char *)"",(char *)"",(char *)"",(char *)"");
MacroVars("RABCDE", "sdssss",(char *)"NOTIFY",nodes.Notify,(char *)"",(char *)"",(char *)"",(char *)"");
MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp);
MacroClear();
}
@ -433,14 +433,19 @@ void GetRpSubject(const char *report, char* subject)
int MsgResult(const char * report, FILE *fo)
{
FILE *fi;
char *temp;
char *temp, *resp;
int res;
temp = calloc(256,sizeof(char));
resp = calloc(256,sizeof(char));
if ((fi = OpenMacro(report, nodes.Language)) != NULL){
while ( fgets(temp, 254, fi) != NULL ){
if (temp[0] != '#')
fprintf(fo,"%s\r",ParseMacro(temp,&res));
if (temp[0] != '#') {
strncpy(resp, ParseMacro(temp, &res), 80);
if ((res == 0) && strlen(resp))
fprintf(fo,"%s\r",ParseMacro(temp,&res));
}
}
fclose(fi);
res=1;
@ -448,6 +453,7 @@ int MsgResult(const char * report, FILE *fo)
res = 0;
}
free(resp);
free(temp);
return res;
}