Added Newsgroup area type, same as echomail just changes 'to' to all

This commit is contained in:
Andrew Pamment 2016-12-09 19:47:33 +10:00
parent fe88e363aa
commit 12f874c015
4 changed files with 29 additions and 14 deletions

1
bbs.h
View File

@ -21,6 +21,7 @@
#define TYPE_LOCAL_AREA 0 #define TYPE_LOCAL_AREA 0
#define TYPE_NETMAIL_AREA 1 #define TYPE_NETMAIL_AREA 1
#define TYPE_ECHOMAIL_AREA 2 #define TYPE_ECHOMAIL_AREA 2
#define TYPE_NEWSGROUP_AREA 3
struct fido_addr { struct fido_addr {
unsigned short zone; unsigned short zone;

View File

@ -283,7 +283,7 @@ void bwave_create_packet() {
flags |= INF_ECHO; flags |= INF_ECHO;
} }
if (conf.mail_conferences[i]->mail_areas[j]->type == TYPE_ECHOMAIL_AREA) { if (conf.mail_conferences[i]->mail_areas[j]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[i]->mail_areas[j]->type == TYPE_NEWSGROUP_AREA) {
flags |= INF_NO_PRIVATE; flags |= INF_NO_PRIVATE;
flags |= INF_ECHO; flags |= INF_ECHO;
} }
@ -414,11 +414,21 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
jsf.Buffer = (char *)buffer; jsf.Buffer = (char *)buffer;
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_NEWSGROUP_AREA) {
sprintf(buffer, "ALL");
jsf.LoID = JAMSFLD_RECVRNAME;
jsf.HiID = 0;
jsf.DatLen = strlen(buffer);
jsf.Buffer = (char *)buffer;
JAM_PutSubfield(jsp, &jsf);
} else {
jsf.LoID = JAMSFLD_RECVRNAME; jsf.LoID = JAMSFLD_RECVRNAME;
jsf.HiID = 0; jsf.HiID = 0;
jsf.DatLen = strlen(to); jsf.DatLen = strlen(to);
jsf.Buffer = (char *)to; jsf.Buffer = (char *)to;
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
}
jsf.LoID = JAMSFLD_SUBJECT; jsf.LoID = JAMSFLD_SUBJECT;
jsf.HiID = 0; jsf.HiID = 0;
@ -426,7 +436,7 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
jsf.Buffer = (char *)subject; jsf.Buffer = (char *)subject;
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA) { if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_NEWSGROUP_AREA) {
jmh.Attribute |= MSG_TYPEECHO; jmh.Attribute |= MSG_TYPEECHO;
if (conf.mail_conferences[confr]->fidoaddr->point) { if (conf.mail_conferences[confr]->fidoaddr->point) {
@ -665,7 +675,7 @@ void bwave_upload_reply() {
addr.node = converts(upl_rec.destnode); addr.node = converts(upl_rec.destnode);
addr.zone = converts(upl_rec.destpoint); addr.zone = converts(upl_rec.destpoint);
netmail = 1; netmail = 1;
} else if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA) { } else if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_NEWSGROUP_AREA) {
if (msg_attr & UPL_PRIVATE) { if (msg_attr & UPL_PRIVATE) {
continue; continue;
} }

View File

@ -1626,7 +1626,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
sprintf(from, "%s %s", user->firstname, user->lastname); sprintf(from, "%s %s", user->firstname, user->lastname);
} }
} }
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_WWIV && conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) { if ((conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_WWIV && conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
to = (char *)malloc(4); to = (char *)malloc(4);
strcpy(to, "ALL"); strcpy(to, "ALL");
} else { } else {
@ -1676,7 +1676,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) { if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
jmh.Attribute |= MSG_TYPEECHO; jmh.Attribute |= MSG_TYPEECHO;
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) {
@ -1830,7 +1830,7 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
sem_fd = open(conf.netmail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); sem_fd = open(conf.netmail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
close(sem_fd); close(sem_fd);
} }
} else if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) { } else if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
if (conf.echomail_sem != NULL) { if (conf.echomail_sem != NULL) {
sem_fd = open(conf.echomail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); sem_fd = open(conf.echomail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
close(sem_fd); close(sem_fd);
@ -2034,7 +2034,7 @@ int mail_menu(struct user_record *user) {
s_printf(get_string(113)); s_printf(get_string(113));
break; break;
} }
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_WWIV && conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) { if ((conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_WWIV && conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
sprintf(buffer, "ALL"); sprintf(buffer, "ALL");
} else { } else {
s_printf(get_string(54)); s_printf(get_string(54));
@ -2147,7 +2147,7 @@ int mail_menu(struct user_record *user) {
jsf.Buffer = (char *)subject; jsf.Buffer = (char *)subject;
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) { if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
jmh.Attribute |= MSG_TYPEECHO; jmh.Attribute |= MSG_TYPEECHO;
if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) { if (conf.mail_conferences[user->cur_mail_conf]->nettype == NETWORK_FIDO) {
@ -2272,7 +2272,7 @@ int mail_menu(struct user_record *user) {
sem_fd = open(conf.netmail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); sem_fd = open(conf.netmail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
close(sem_fd); close(sem_fd);
} }
} else if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA) { } else if (conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_ECHOMAIL_AREA || conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->type == TYPE_NEWSGROUP_AREA) {
if (conf.echomail_sem != NULL) { if (conf.echomail_sem != NULL) {
sem_fd = open(conf.echomail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); sem_fd = open(conf.echomail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
close(sem_fd); close(sem_fd);

4
main.c
View File

@ -262,6 +262,8 @@ static int mail_area_handler(void* user, const char* section, const char* name,
mc->mail_areas[i]->type = TYPE_ECHOMAIL_AREA; mc->mail_areas[i]->type = TYPE_ECHOMAIL_AREA;
} else if (strcasecmp(value, "netmail") == 0) { } else if (strcasecmp(value, "netmail") == 0) {
mc->mail_areas[i]->type = TYPE_NETMAIL_AREA; mc->mail_areas[i]->type = TYPE_NETMAIL_AREA;
} else if (strcasecmp(value, "newsgroup") == 0) {
mc->mail_areas[i]->type = TYPE_NEWSGROUP_AREA;
} }
} else if (strcasecmp(name, "qwk name") == 0) { } else if (strcasecmp(name, "qwk name") == 0) {
mc->mail_areas[i]->qwkname = strdup(value); mc->mail_areas[i]->qwkname = strdup(value);
@ -296,6 +298,8 @@ static int mail_area_handler(void* user, const char* section, const char* name,
mc->mail_areas[mc->mail_area_count]->type = TYPE_ECHOMAIL_AREA; mc->mail_areas[mc->mail_area_count]->type = TYPE_ECHOMAIL_AREA;
} else if (strcasecmp(value, "netmail") == 0) { } else if (strcasecmp(value, "netmail") == 0) {
mc->mail_areas[mc->mail_area_count]->type = TYPE_NETMAIL_AREA; mc->mail_areas[mc->mail_area_count]->type = TYPE_NETMAIL_AREA;
} else if (strcasecmp(value, "newsgroup") == 0) {
mc->mail_areas[mc->mail_area_count]->type = TYPE_NEWSGROUP_AREA;
} }
} else if (strcasecmp(name, "qwk name") == 0) { } else if (strcasecmp(name, "qwk name") == 0) {
mc->mail_areas[mc->mail_area_count]->qwkname = strdup(value); mc->mail_areas[mc->mail_area_count]->qwkname = strdup(value);