Board: [WWIVnet] WWIV Development Subject: Switchable ListPlus From: Xenos #1 @60 Date: Sat Dec 27, 2025 03:57 This patch/mod is my answer to issue #1673 to make ListPlus switchable. diff --git a/bbs/defaults.cpp b/bbs/defaults.cpp +++ b/bbs/defaults.cpp @@ -164,7 +164,9 @@ static void print_cur_stat() { (a()->user()->has_flag(User::fullScreenReader) ? "Full-Screen" : "Traditional")); } bout.print("I) Internet Address : {}\r\n", inet_addr); - bout.pl("K) Configure Menus"); + bout.print("K) Configure Menus L) ListPlus On : {}\r\n", YesNoString(a()->user()->data.lp_options & cfl_enable)); + + if (num_instances() > 1) { bout.print("M) Allow user msgs : {:<16} N) Configure QWK", YesNoString(!a()->user()->ignore_msgs())); } @@ -735,7 +737,7 @@ void defaults(bool& need_menu_reload) { } bout.nl(); bout.outstr("Defaults: "); - std::string allowable = "Q?1234567BCDIKMNTUW"; + std::string allowable = "Q?1234567BCDIKLMNTUW"; if (okansi()) { allowable.append("89AS"); if (a()->fullscreen_read_prompt()) { @@ -803,6 +805,13 @@ void defaults(bool& need_menu_reload) { wwiv::bbs::menus::ConfigUserMenuSet(""); need_menu_reload = true; break; + case 'L': + if (a()->user()->data.lp_options & cfl_enable) { + a()->user()->data.lp_options &= ~cfl_enable; + } else { + a()->user()->data.lp_options |= cfl_enable; + }; + break; case 'M': a()->user()->toggle_flag(User::noMsgs); break; diff --git a/bbs/xfer.cpp b/bbs/xfer.cpp index f6df30d3e..64004667e 100644 --- a/bbs/xfer.cpp +++ b/bbs/xfer.cpp @@ -300,7 +300,7 @@ void listfiles() { return; } - if (okansi()) { + if (okansi() && a()->user()->data.lp_options & cfl_enable ) { listfiles_plus(LP_LIST_DIR); return; } @@ -345,7 +345,7 @@ void nscandir(uint16_t nDirNum, bool& need_title, bool *abort) { a()->set_current_user_dir_num(nDirNum); dliscan(); if (this_date >= a()->sess().nscandate()) { - if (okansi()) { + if (okansi() && a()->user()->data.lp_options & cfl_enable) { *abort = listfiles_plus(LP_NSCAN_DIR) ? 1 : 0; a()->set_current_user_dir_num(old_cur_dir); return; @@ -391,7 +391,7 @@ void nscanall() { tmp_disable_conf(true); } } - if (okansi()) { + if (okansi() && a()->user()->data.lp_options & cfl_enable) { const auto save_dir = a()->current_user_dir_num(); listfiles_plus(LP_NSCAN_NSCAN); if (scan_all_confs) { @@ -436,7 +436,7 @@ void searchall() { bout.pl("No directories available."); return; } - if (okansi()) { + if (okansi() && a()->user()->data.lp_options & cfl_enable ) { listfiles_plus(LP_SEARCH_ALL); return; } diff --git a/bbs/xferovl.cpp b/bbs/xferovl.cpp index 4ce56965e..a7543cd39 100644 --- a/bbs/xferovl.cpp +++ b/bbs/xferovl.cpp @@ -739,7 +739,13 @@ void xfer_defaults() { YesNoString(a()->user()->newscan_files())); bout.print("[4] Number of lines of extended description to print [{} line(s)].\r\n", a()->user()->GetNumExtended()); - const std::string onek_options = "Q12345"; + if (okansi()) { + bout.print("[L] ListPlus Enabled: ({})\r\n", YesNoString(a()->user()->data.lp_options & cfl_enable)); + } + if (a()->user()->data.lp_options & cfl_enable) { + bout.print("[K] Configure ListPlus\r\n"); + } + const std::string onek_options = "Q12345KL"; bout.outstr("[Q] Quit.\r\n\n"); bout.outstr("Which? "); char ch = onek(onek_options); @@ -775,6 +781,16 @@ void xfer_defaults() { } } break; + case 'L': + if (a()->user()->data.lp_options & cfl_enable) { + a()->user()->data.lp_options &= ~cfl_enable; + } else { + a()->user()->data.lp_options |= cfl_enable; + }; + break; + case 'K': + config_file_list(); + break; } } while (!done && !a()->sess().hangup()); diff --git a/sdk/user.h b/sdk/user.h index 9c23afe88..aa2a395ff 100644 --- a/sdk/user.h +++ b/sdk/user.h @@ -47,6 +47,7 @@ static constexpr uint32_t unused_cfl_times_a_day_dloaded = 0x00000100; static constexpr uint32_t unused_cfl_days_between_dloads = 0x00000200; static constexpr uint32_t cfl_description = 0x00000400; static constexpr uint32_t cfl_header = 0x80000000; +static constexpr uint32_t cfl_enable = 0x10000000; namespace wwiv::sdk { struct validation_config_t; @@ -1076,4 +1077,4 @@ int years_old(const User* u, core::Clock& clock); } // namespace wwiv::sdk -#endif \ No newline at end of file +#endif A .-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-. /*\ ] /\liens' /\lcove! WWIV on Linux, Taguig, Metro Manila, Philippines [ / v \`-=-=-=-=-=-=-=-=-=-=-=-[ WWIV Development ]-=-=--=-=-=-=-=-=-=-=-=-=-' .