From ecb180285437ae8b20e16747433d55cdb408f7dc Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Fri, 25 Mar 2016 22:46:35 +1000 Subject: [PATCH] Added email notification to login --- bbs.c | 12 ++++++++++++ doors.c | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bbs.c b/bbs.c index eae310b..1b9d714 100644 --- a/bbs.c +++ b/bbs.c @@ -723,6 +723,18 @@ void runbbs(int socket, char *config_path) { display_last10_callers(socket, user, 1); + // check email + i = mail_getemailcount(user); + if (i > 0) { + sprintf(buffer, "\r\nYou have %d e-mail(s) in your inbox.\r\n", i); + s_putstring(socket, buffer); + } else { + s_putstring(socket, "\r\nYou have no e-mail.\r\n"); + } + sprintf(buffer, "\r\nPress any key to continue...\r\n"); + s_putstring(socket, buffer); + s_getc(socket); + // main menu main_menu(socket, user); diff --git a/doors.c b/doors.c index bdaef9d..6b5a410 100644 --- a/doors.c +++ b/doors.c @@ -75,8 +75,14 @@ int door_menu(int socket, struct user_record *user) { dodoors = 1; break; case 'g': - doquit = 1; - dodoors = 1; + { + s_putstring(socket, "\r\nAre you sure you want to log off? (Y/N)"); + c = s_getc(socket); + if (tolower(c) == 'y') { + doquit = 1; + dodoors = 1; + } + } break; default: {