From b18e9ee10e292fa5352dfa53a3501fc61e7b7f2a Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Thu, 8 Dec 2016 16:32:05 +1000 Subject: [PATCH] Added abiltiy to change default archiver --- magicka.strings | 4 ++++ settings.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/magicka.strings b/magicka.strings index b497698..5249353 100644 --- a/magicka.strings +++ b/magicka.strings @@ -203,3 +203,7 @@ Is this Correct? (Y/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 +\e[0;36mA. \e[1;37mDefault Archiver (\e[1;33m%s\e[1;37m)\r\n +\r\n\e[1;32mSelect an archiver...\e[0m\r\n\r\n +\e[1;31m%d. \e[1;37m%s\e[0m\r\n +> diff --git a/settings.c b/settings.c index a7fcc30..1c64b9a 100644 --- a/settings.c +++ b/settings.c @@ -4,17 +4,22 @@ #include #include "bbs.h" +extern struct bbs_config conf; + void settings_menu(struct user_record *user) { char buffer[256]; int dosettings = 0; char c; char *hash; + int new_arc; + int i; while (!dosettings) { s_printf(get_string(149)); s_printf(get_string(150)); s_printf(get_string(151)); s_printf(get_string(152), user->location); + s_printf(get_string(205), conf.archivers[user->defarchiver - 1]->name); s_printf(get_string(153)); s_printf(get_string(154)); @@ -64,6 +69,26 @@ void settings_menu(struct user_record *user) { save_user(user); } break; + case 'a': + { + s_printf(get_string(206)); + + for (i=0;iname); + } + + s_printf(get_string(208)); + s_readstring(buffer, 5); + new_arc = atoi(buffer); + + if (new_arc - 1 < 0 || new_arc > conf.archiver_count) { + break; + } else { + user->defarchiver = new_arc; + save_user(user); + } + } + break; case 'q': dosettings = 1; break;