This commit is contained in:
Andrew Pamment 2016-12-08 11:08:42 +10:00
commit 24ea37c001
4 changed files with 29 additions and 19 deletions

View File

@ -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

View File

@ -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)

View File

@ -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();
}

View File

@ -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