Added GoldED groupid's for sorting

This commit is contained in:
Michiel Broek 2006-03-27 20:38:01 +00:00
parent 95d3eb2092
commit 6e92eb3437
6 changed files with 272 additions and 161 deletions

View File

@ -1,7 +1,10 @@
$Id$
v0.83.16 13-Mar-2006
v0.83.17 27-Mar-2006
v0.83.16 13-Mar-2006 - 27-Mar-2006
mbfido:
If sending crash to a node not in the setup, a default
@ -9,9 +12,15 @@ v0.83.16 13-Mar-2006
Accept unpacket mail for own points.
In created ticfiles in advanced seen-by mode, setting the node
to 4d will add point numbers to the seen-by lines if needed.
When message areas are auto changed, the updated golded.inc
file now has the groupid numbers from the groups in echomail
or news areas.
mbsetup:
Added setup switch for tic nodes that need a 4d seen-by line.
When saving message areas, the golded.inc file now has the
groupid numbers from the groups in echomail or news areas.
The message groups now handle groupnumbers for golded groups.
v0.83.15 05-Mar-2006 - 13-Mar-2006

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -14,7 +14,7 @@
</HEAD>
<BODY>
<BLOCKQUOTE>
<div align="right"><h5>Last update 23-Feb-2004</h5></div>
<div align="right"><h5>Last update 27-Mar-2006</h5></div>
<div align="center"><H1>MBSE BBS Setup - Mail Setup - Message Groups.</H1></div>
<H3>Introduction.</H3>
@ -56,6 +56,7 @@ skip a number of extra areas for future expansion.
<strong>Uplink </strong>The Fidonet aka of your uplink.
<strong>Areas </strong>Areas file in the path defined in 1.4.6 screen 2.
<strong>Charset </strong>Default character set to use.
<strong>GoldED grp </strong>Groupnumber for GoldED include file.
</pre>
<P>
<IMG SRC="../images/emgroup.png" alt='Mail groups setup'>

View File

@ -4,7 +4,7 @@
* Purpose ...............: Create Message Area
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2006
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -358,8 +358,8 @@ void msged_areas(FILE *fp)
void gold_areas(FILE *fp)
{
char *temp, *aka;
FILE *no;
char *temp, *aka, groupid[13];
FILE *no, *fil;
int i = 0;
temp = calloc(PATH_MAX, sizeof(char));
@ -387,11 +387,39 @@ void gold_areas(FILE *fp)
else
fprintf(fp, "AREA%d", i);
fprintf(fp, " \"%s\" ", msgs.Name);
/*
* Set a default groupid
*/
switch (msgs.Type) {
case LOCALMAIL : fprintf(fp, "0 Local"); break;
case NETMAIL : fprintf(fp, "N Net"); break;
case ECHOMAIL : fprintf(fp, "C Echo"); break;
case NEWS : fprintf(fp, "I News"); break;
case LOCALMAIL : snprintf(groupid, 13, "O"); break;
case NETMAIL : snprintf(groupid, 13, "N"); break;
case ECHOMAIL : snprintf(groupid, 13, "C"); break;
case NEWS : snprintf(groupid, 13, "I"); break;
}
/*
* Now try to find a real groupid
*/
if (((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS)) && strlen(msgs.Group)) {
snprintf(temp, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT"));
if ((fil = fopen(temp, "r")) != NULL) {
fread(&mgrouphdr, sizeof(mgrouphdr), 1, fil);
while (fread(&mgroup, mgrouphdr.recsize, 1, fil) == 1) {
if (mgroup.Active && !strcmp(msgs.Group, mgroup.Name) && mgroup.GoldEDgroup) {
snprintf(groupid, 13, "%d", mgroup.GoldEDgroup);
break;
}
}
fclose(fil);
}
}
fprintf(fp, "%s ", groupid);
switch (msgs.Type) {
case LOCALMAIL : fprintf(fp, "Local"); break;
case NETMAIL : fprintf(fp, "Net"); break;
case ECHOMAIL : fprintf(fp, "Echo"); break;
case NEWS : fprintf(fp, "News"); break;
}
aka = xstrcpy(strtok(aka2str(msgs.Aka), "@"));
fprintf(fp, " JAM %s %s ", msgs.Base, aka);

View File

@ -1780,17 +1780,21 @@ void msged_areas(FILE *fp)
}
/*
* AREADEF Syntax: Echoid "Description" Groupid Type Format Path or board Aka (Attributes) "Origin"
*/
void gold_areas(FILE *fp)
{
char *temp, *aka;
FILE *no;
char *temp, *aka, groupid[13];
FILE *no, *fil;
int i = 0;
temp = calloc(PATH_MAX, sizeof(char));
snprintf(temp, PATH_MAX, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((no = fopen(temp, "r")) == NULL)
if ((no = fopen(temp, "r")) == NULL) {
free(temp);
return;
}
fread(&msgshdr, sizeof(msgshdr), 1, no);
fseek(no, 0, SEEK_SET);
@ -1810,11 +1814,38 @@ void gold_areas(FILE *fp)
else
fprintf(fp, "AREA%d", i);
fprintf(fp, " \"%s\" ", msgs.Name);
/*
* Set a default groupid
*/
switch (msgs.Type) {
case LOCALMAIL : fprintf(fp, "0 Local"); break;
case NETMAIL : fprintf(fp, "N Net"); break;
case ECHOMAIL : fprintf(fp, "C Echo"); break;
case NEWS : fprintf(fp, "I News"); break;
case LOCALMAIL : snprintf(groupid, 13, "O"); break;
case NETMAIL : snprintf(groupid, 13, "N"); break;
case ECHOMAIL : snprintf(groupid, 13, "C"); break;
case NEWS : snprintf(groupid, 13, "I"); break;
}
/*
* Now try to find a real groupid
*/
if (((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS)) && strlen(msgs.Group)) {
snprintf(temp, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT"));
if ((fil = fopen(temp, "r")) != NULL) {
fread(&mgrouphdr, sizeof(mgrouphdr), 1, fil);
while (fread(&mgroup, mgrouphdr.recsize, 1, fil) == 1) {
if (mgroup.Active && !strcmp(msgs.Group, mgroup.Name) && mgroup.GoldEDgroup) {
snprintf(groupid, 13, "%d", mgroup.GoldEDgroup);
break;
}
}
fclose(fil);
}
}
fprintf(fp, "%s ", groupid);
switch (msgs.Type) {
case LOCALMAIL : fprintf(fp, "Local"); break;
case NETMAIL : fprintf(fp, "Net"); break;
case ECHOMAIL : fprintf(fp, "Echo"); break;
case NEWS : fprintf(fp, "News"); break;
}
aka = xstrcpy(strtok(aka2str(msgs.Aka), "@"));
fprintf(fp, " JAM %s %s ", msgs.Base, aka);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Setup MGroups.
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2006
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -42,6 +42,8 @@
int MGrpUpdated = 0;
unsigned int *gedgrps;
extern int exp_golded;
/*
@ -100,8 +102,13 @@ int OpenMGroup(void)
{
FILE *fin, *fout;
char fnin[PATH_MAX], fnout[PATH_MAX], temp[13];
int oldsize;
int i;
int oldsize, i, record;
/*
* Init GoldED grouptable
*/
gedgrps = (unsigned int *)malloc(1001 * sizeof(unsigned int));
memset(gedgrps, 0, 1001 * sizeof(unsigned int));
snprintf(fnin, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT"));
snprintf(fnout, PATH_MAX, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
@ -138,7 +145,9 @@ int OpenMGroup(void)
* will be empty.
*/
memset(&mgroup, 0, sizeof(mgroup));
record = 0;
while (fread(&mgroup, oldsize, 1, fin) == 1) {
record++;
if (MGrpUpdated && !strlen(mgroup.BasePath)) {
memset(&temp, 0, sizeof(temp));
strcpy(temp, mgroup.Name);
@ -157,7 +166,11 @@ int OpenMGroup(void)
if (MGrpUpdated && (mgroup.Charset == FTNC_NONE)) {
mgroup.Charset = FTNC_CP437;
}
if (MGrpUpdated && !mgroup.GoldEDgroup) {
mgroup.GoldEDgroup = record;
}
fwrite(&mgroup, sizeof(mgroup), 1, fout);
gedgrps[mgroup.GoldEDgroup] = 1;
memset(&mgroup, 0, sizeof(mgroup));
}
@ -179,6 +192,7 @@ void CloseMGroup(int force)
FILE *fi, *fo;
st_list *mgr = NULL, *tmp;
free(gedgrps);
snprintf(fin, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT"));
snprintf(fout, PATH_MAX, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
@ -210,6 +224,7 @@ void CloseMGroup(int force)
Syslog('+', "Updated \"mgroups.data\"");
if (!force)
working(6, 0, 0);
exp_golded = TRUE;
return;
}
}
@ -224,6 +239,7 @@ int AppendMGroup(void)
{
FILE *fil;
char ffile[PATH_MAX];
int i;
snprintf(ffile, PATH_MAX, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
if ((fil = fopen(ffile, "a")) != NULL) {
@ -232,6 +248,13 @@ int AppendMGroup(void)
mgroup.LinkSec.level = 1;
mgroup.LinkSec.flags = 1;
mgroup.Charset = FTNC_CP437;
for (i = 1; i < 1000; i++) {
if (gedgrps[i] == 0) {
gedgrps[i] = 1;
mgroup.GoldEDgroup = i;
break;
}
}
fwrite(&mgroup, sizeof(mgroup), 1, fil);
fclose(fil);
MGrpUpdated = 1;
@ -270,6 +293,7 @@ void MgScreen(void)
mbse_mvprintw(19,26, "19. Areas");
mbse_mvprintw(14,54, "20. Charset");
mbse_mvprintw(15,54, "21. GED grp");
}
@ -304,6 +328,7 @@ int EditMGrpRec(int Area)
static int offset;
static int i, j, tmp;
unsigned int crc, crc1;
int oldgrp, newgrp;
clr_index();
working(1, 0, 0);
@ -351,8 +376,9 @@ int EditMGrpRec(int Area)
show_str( 19,42,12, mgroup.AreaFile);
show_charset(14,70, mgroup.Charset);
show_int( 15, 70, mgroup.GoldEDgroup);
j = select_menu(20);
j = select_menu(21);
switch(j) {
case 0: if (!mgroup.StartArea && strlen(mgroup.AreaFile)) {
errmsg("Areas file defined but no BBS start area");
@ -429,6 +455,20 @@ int EditMGrpRec(int Area)
case 19:E_STR( 19,42,12, mgroup.AreaFile, "The name of the ^Areas File^ from the uplink (case sensitive)")
case 20:mgroup.Charset = edit_charset(14, 70, mgroup.Charset);
break;
case 21:oldgrp = mgroup.GoldEDgroup;
newgrp = edit_int(15, 70, oldgrp, (char *)"The new groupnumber for the ^GoldED groups^ (1..999)");
if ((newgrp < 1) || (newgrp > 999)) {
errmsg("Groupnumber must be between 1 and 999");
} else if (newgrp && (newgrp != oldgrp)) {
if (gedgrps[newgrp] == 1) {
errmsg("This groupnumber is already in use");
} else {
gedgrps[oldgrp] = 0;
gedgrps[newgrp] = 1;
mgroup.GoldEDgroup = newgrp;
}
}
break;
}
}
@ -698,6 +738,7 @@ int mail_group_doc(FILE *fp, FILE *toc, int page)
add_webtable(wp, (char *)"Auto add/del areas", getboolean(mgroup.AutoChange));
add_webtable(wp, (char *)"User add/del areas", getboolean(mgroup.UserChange));
add_webtable(wp, (char *)"Default charset", getftnchrs(mgroup.Charset));
add_webdigit(wp, (char *)"GoldED groupid", mgroup.GoldEDgroup);
tt = (time_t)mgroup.StartDate;
add_webtable(wp, (char *)"Start area date", ctime(&tt));
tt = (time_t)mgroup.LastDate;
@ -793,6 +834,7 @@ int mail_group_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Auto add/del areas %s\n", getboolean(mgroup.AutoChange));
fprintf(fp, " User add/del areas %s\n", getboolean(mgroup.UserChange));
fprintf(fp, " Default charset %s\n", getftnchrs(mgroup.Charset));
fprintf(fp, " GoldED groupid %d\n", mgroup.GoldEDgroup);
tt = (time_t)mgroup.StartDate;
fprintf(fp, " Start area date %s", ctime(&tt));
tt = (time_t)mgroup.LastDate;