From 8c57fc580fa2f82fc0143df4579f572abf043e26 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 12 Aug 2004 15:08:20 +0000 Subject: [PATCH] Changed to support BBBS uplink requests --- ChangeLog | 9 ++++++ TODO | 2 -- mbfido/createf.c | 7 +++-- mbfido/createm.c | 7 +++-- mbfido/mgrutil.c | 74 +++++++++++++++++++++++++++--------------------- mbsetup/m_node.c | 2 -- 6 files changed, 60 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1e7e0d6..f0429da0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,16 +3,25 @@ $Id$ v0.61.4 11-Aug-2004 + upgrade: + If you have BBBS uplinks and use automatic uplink requests then + change the setup of these nodes in screen 7.10. + mbfido: No help was displayed when no valid command was given. Echomail for non-existing areas now finally is stored in the badmail area. Echomail received from not connected nodes is stored in the badmail area unless the area allowes it. + Can now send (hopefully) valid uplink requests to BBBS systems. mbuser: Fixed permissions. + mbsetup: + Changed nodes screens to have a separate uplink managers setup + screen, and added switches for BBBS uplinks. + v0.61.3 25-Jul-2004 - 11-Aug-2004 diff --git a/TODO b/TODO index 502537fc..e6005774 100644 --- a/TODO +++ b/TODO @@ -116,8 +116,6 @@ mbfido: N: Implement areamgr/filemgr %avail command to list available areas from areas files. - N: Areamgr uplink request, add change for bbbs (Aarrrgghhh). - mbcico: L: Implement binkp option ND. diff --git a/mbfido/createf.c b/mbfido/createf.c index ef8f9d59..1fdf56d9 100644 --- a/mbfido/createf.c +++ b/mbfido/createf.c @@ -190,8 +190,11 @@ int CheckTicGroup(char *Area, int SendUplink, faddr *f) * Area is in AREAS file, now create area. * If needed, connect at uplink. */ - if (SendUplink) { - sprintf(temp, "+%s", tag); + if (SendUplink && SearchNode(fgroup.UpLink)) { + if (nodes.UplFmgrBbbs) + sprintf(temp, "file +%s", tag); + else + sprintf(temp, "+%s", tag); From = fido2faddr(fgroup.UseAka); To = fido2faddr(fgroup.UpLink); diff --git a/mbfido/createm.c b/mbfido/createm.c index 125cdec9..de4c9677 100644 --- a/mbfido/createm.c +++ b/mbfido/createm.c @@ -126,8 +126,11 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f) * Area is in AREAS file, now create area. * If needed, connect at uplink. */ - if (SendUplink) { - sprintf(temp, "+%s", tag); + if (SendUplink && SearchNode(mgroup.UpLink)) { + if (nodes.UplAmgrBbbs) + sprintf(temp, "echo +%s", tag); + else + sprintf(temp, "+%s", tag); From = fido2faddr(mgroup.UseAka); To = fido2faddr(mgroup.UpLink); if (UplinkRequest(To, From, FALSE, temp)) { diff --git a/mbfido/mgrutil.c b/mbfido/mgrutil.c index b579f047..b1db25a3 100644 --- a/mbfido/mgrutil.c +++ b/mbfido/mgrutil.c @@ -550,7 +550,7 @@ int Areas(void) fseek(gp, mgrouphdr.hdrsize, SEEK_SET); while ((fread(&mgroup, mgrouphdr.recsize, 1, gp)) == 1) { - if (mgroup.Active && mgroup.AutoChange && strlen(mgroup.AreaFile)) { + if (mgroup.Active && mgroup.AutoChange && strlen(mgroup.AreaFile) && mgroup.UpLink.zone && SearchNode(mgroup.UpLink)) { if (!do_quiet) { colour(CYAN, BLACK); printf("\rEcho group %-12s ", mgroup.Name); @@ -633,10 +633,14 @@ int Areas(void) */ CheckEchoGroup(tmp->Name, FALSE, NULL); if (cmd == NULL) { - cmd = xstrcpy((char *)"+"); + cmd = xstrcpy((char *)""); } else { - cmd = xstrcat(cmd, (char *)"\r+"); + cmd = xstrcat(cmd, (char *)"\r"); } + if (nodes.UplAmgrBbbs) + cmd = xstrcat(cmd, (char *)"echo +"); + else + cmd = xstrcat(cmd, (char *)"+"); cmd = xstrcat(cmd, tmp->Name); if (CFG.slow_util && do_quiet) msleep(1); @@ -692,9 +696,13 @@ int Areas(void) * Prepare uplink command */ if (cmd == NULL) - cmd = xstrcpy((char *)"-"); + cmd = xstrcpy((char *)""); else - cmd = xstrcat(cmd, (char *)"\r-"); + cmd = xstrcat(cmd, (char *)"\r"); + if (nodes.UplAmgrBbbs) + cmd = xstrcat(cmd, (char *)"echo -"); + else + cmd = xstrcat(cmd, (char *)"-"); cmd = xstrcat(cmd, tmp->Name); break; } else { @@ -710,19 +718,15 @@ int Areas(void) /* * Sent one uplink command with additions and deletions */ - if (mgroup.UpLink.zone) { - From = fido2faddr(mgroup.UseAka); - To = fido2faddr(mgroup.UpLink); - if (UplinkRequest(To, From, FALSE, cmd)) { - WriteError("Uplink request failed"); - } else { - Mgrlog("AreaMgr request sent to %s", aka2str(mgroup.UpLink)); - } - tidy_faddr(From); - tidy_faddr(To); + From = fido2faddr(mgroup.UseAka); + To = fido2faddr(mgroup.UpLink); + if (UplinkRequest(To, From, FALSE, cmd)) { + WriteError("Uplink request failed"); } else { - Syslog('+', "No uplink defined, not sending a AreaMgr request"); + Mgrlog("AreaMgr request sent to %s", aka2str(mgroup.UpLink)); } + tidy_faddr(From); + tidy_faddr(To); free(cmd); cmd = NULL; } @@ -731,7 +735,7 @@ int Areas(void) fflush(stdout); } } - } + } } fclose(gp); } @@ -744,7 +748,7 @@ int Areas(void) fseek(gp, fgrouphdr.hdrsize, SEEK_SET); while ((fread(&fgroup, fgrouphdr.recsize, 1, gp)) == 1) { - if (fgroup.Active && fgroup.AutoChange && strlen(fgroup.AreaFile)) { + if (fgroup.Active && fgroup.AutoChange && strlen(fgroup.AreaFile) && fgroup.UpLink.zone && SearchNode(fgroup.UpLink)) { if (!do_quiet) { colour(CYAN, BLACK); printf("\r TIC group %-12s ", fgroup.Name); @@ -879,10 +883,14 @@ int Areas(void) */ CheckTicGroup(tmp->Name, FALSE, NULL); if (cmd == NULL) { - cmd = xstrcpy((char *)"+"); + cmd = xstrcpy((char *)""); } else { - cmd = xstrcat(cmd, (char *)"\r+"); + cmd = xstrcat(cmd, (char *)"\r"); } + if (nodes.UplFmgrBbbs) + cmd = xstrcat(cmd, (char *)"file +"); + else + cmd = xstrcat(cmd, (char *)"+"); cmd = xstrcat(cmd, tmp->Name); if (CFG.slow_util && do_quiet) msleep(1); @@ -919,9 +927,13 @@ int Areas(void) * Prepare uplink command */ if (cmd == NULL) - cmd = xstrcpy((char *)"-"); + cmd = xstrcpy((char *)""); else - cmd = xstrcat(cmd, (char *)"\r-"); + cmd = xstrcat(cmd, (char *)"\r"); + if (nodes.UplFmgrBbbs) + cmd = xstrcat(cmd, (char *)"file -"); + else + cmd = xstrcat(cmd, (char *)"-"); cmd = xstrcat(cmd, tmp->Name); } fseek(fp, tichdr.syssize, SEEK_CUR); @@ -968,19 +980,15 @@ int Areas(void) /* * Sent one uplink command with additions and deletions */ - if (fgroup.UpLink.zone) { - From = fido2faddr(fgroup.UseAka); - To = fido2faddr(fgroup.UpLink); - if (UplinkRequest(To, From, TRUE, cmd)) { - WriteError("Uplink request failed"); - } else { - Mgrlog("FileMgr request sent to %s", aka2str(fgroup.UpLink)); - } - tidy_faddr(From); - tidy_faddr(To); + From = fido2faddr(fgroup.UseAka); + To = fido2faddr(fgroup.UpLink); + if (UplinkRequest(To, From, TRUE, cmd)) { + WriteError("Uplink request failed"); } else { - Syslog('+', "No uplink defined, not sending a FileMgr request"); + Mgrlog("FileMgr request sent to %s", aka2str(fgroup.UpLink)); } + tidy_faddr(From); + tidy_faddr(To); free(cmd); cmd = NULL; } diff --git a/mbsetup/m_node.c b/mbsetup/m_node.c index 9ab76455..48864401 100644 --- a/mbsetup/m_node.c +++ b/mbsetup/m_node.c @@ -1565,8 +1565,6 @@ int node_doc(FILE *fp, FILE *toc, int page) add_webtable(wp, (char *)" Advanded SB lines in .TIC", getboolean(nodes.TIC_AdvSB)); fprintf(fp, " Sent To line %s", getboolean(nodes.TIC_To)); add_webtable(wp, (char *)"Sent 'To' lines in .TIC", getboolean(nodes.TIC_To)); - fprintf(fp, " Uplink add + %s\n", getboolean(nodes.AddPlus)); - add_webtable(wp, (char *)" Uplink add +", getboolean(nodes.AddPlus)); fprintf(fp, " Security flags %s\n\n", getflag(nodes.Security.flags, nodes.Security.notflags)); add_webtable(wp, (char *)"Security flags", getflag(nodes.Security.flags, nodes.Security.notflags)); fprintf(wp, " \n");