From 496e9575272081c7a6c12492bff5a60f54341db9 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 7 Dec 2016 20:04:42 +1000 Subject: [PATCH 1/2] Added message when bluewave mail is imported --- bluewave.c | 40 +++++++++++++++++++++++++--------------- magicka.strings | 1 + 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/bluewave.c b/bluewave.c index 37ac681..21a4ae7 100644 --- a/bluewave.c +++ b/bluewave.c @@ -559,6 +559,9 @@ void bwave_upload_reply() { FILE *upl_file; FILE *msg_file; int sem_fd; + int msg_count; + + msg_count = 0; snprintf(buffer, 1024, "%s/node%d", conf.bbs_path, mynode); @@ -661,15 +664,16 @@ void bwave_upload_reply() { addr.net = converts(upl_rec.destnet); addr.node = converts(upl_rec.destnode); addr.zone = converts(upl_rec.destpoint); + netmail = 1; } else if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA) { if (msg_attr & UPL_PRIVATE) { continue; } - + echomail = 1; } else { // Local area if (msg_attr & UPL_PRIVATE) { continue; - } + } } snprintf(msgbuffer, 1024, "%s/node%d/bwave/%s", conf.bbs_path, mynode, upl_rec.filename); @@ -726,17 +730,7 @@ void bwave_upload_reply() { // failed to add message s_printf(get_string(197)); } else { - if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_NETMAIL_AREA) { - if (conf.netmail_sem != NULL) { - sem_fd = open(conf.netmail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); - close(sem_fd); - } - } else if (conf.mail_conferences[confr]->mail_areas[area]->type == TYPE_ECHOMAIL_AREA) { - if (conf.echomail_sem != NULL) { - sem_fd = open(conf.echomail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); - close(sem_fd); - } - } + msg_count++; } free(body); @@ -747,9 +741,25 @@ void bwave_upload_reply() { snprintf(buffer, 1024, "%s/node%d/bwave/", conf.bbs_path, mynode); recursive_delete(buffer); - - + if (netmail == 1) { + if (conf.netmail_sem != NULL) { + sem_fd = open(conf.netmail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); + close(sem_fd); + } + } + if (echomail == 1) { + if (conf.echomail_sem != NULL) { + sem_fd = open(conf.echomail_sem, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); + close(sem_fd); + } + } + s_printf("\r\n"); + + if (msg_count > 0) { + s_printf(get_string(204), msg_count); + } + s_printf(get_string(6)); s_getc(); } diff --git a/magicka.strings b/magicka.strings index bea1259..b497698 100644 --- a/magicka.strings +++ b/magicka.strings @@ -202,3 +202,4 @@ Is this Correct? (Y/N) ...Found!\r\n\r\n \e[1;32mUpload Successful!\e[0m\r\n \e[1;31mUser not found! Assuming new user...\e[0m\r\n\r\n +\e[1;32mSuccesfully processed \e[1;37m%d \e[1;32mmessages!\r\n\e[0m From 538312d2ad9ad9419813d75ea8fb19737192ad97 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 7 Dec 2016 21:58:58 +1000 Subject: [PATCH 2/2] Update freebsd makefiles --- Makefile.freebsd | 5 ++--- Makefile.freebsd.WWW | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.freebsd b/Makefile.freebsd index d1780d2..1fb6e5e 100644 --- a/Makefile.freebsd +++ b/Makefile.freebsd @@ -4,14 +4,13 @@ DEPS = bbs.h JAMLIB = jamlib/jamlib.a ZMODEM = Xmodem/libzmodem.a LUA = lua/liblua.a -MICROHTTPD= -OBJ = inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o www.o +OBJ = inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) magicka: $(OBJ) - $(CC) -o magicka -o $@ $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 $(JAMLIB) $(ZMODEM) $(LUA) -lutil -lm -lssl -lcrypto -lssh $(MICROHTTPD) + $(CC) -o magicka -o $@ $^ $(CFLAGS) -L/usr/local/lib -lsqlite3 $(JAMLIB) $(ZMODEM) $(LUA) -lutil -lm -lssl -lcrypto -lssh .PHONY: clean diff --git a/Makefile.freebsd.WWW b/Makefile.freebsd.WWW index bd4fa77..e555937 100644 --- a/Makefile.freebsd.WWW +++ b/Makefile.freebsd.WWW @@ -6,7 +6,7 @@ ZMODEM = Xmodem/libzmodem.a LUA = lua/liblua.a MICROHTTPD=-lmicrohttpd -lb64 -OBJ = inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o www.o www_email.o www_msgs.o www_last10.o +OBJ = inih/ini.o bbs.o main.o users.o main_menu.o mail_menu.o doors.o bbs_list.o chat_system.o email.o files.o settings.o lua_glue.o strings.o bluewave.o www.o www_email.o www_msgs.o www_last10.o %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS)