• Switchable ListPlus

    From Xenos #1@60.Wwivnet@11:1/101 to All on Sat Dec 27 03:57:49 2025

    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("|#1I|#9) Internet Address : |#2{}\r\n", inet_addr);
    - bout.pl("|#1K|#9) Configure Menus");
    + bout.print("|#1K|#9) Configure Menus |#1L|#9) ListPlus On : |#2{}\r\n", YesNoString(a()->user()->data.lp_options & cfl_enable));
    +
    +
    if (num_instances() > 1) {
    bout.print("|#1M|#9) Allow user msgs : |#2{:<16} |#1N|#9) Configure QWK", YesNoString(!a()->user()->ignore_msgs()));
    }
    @@ -735,7 +737,7 @@ void defaults(bool& need_menu_reload) {
    }
    bout.nl();
    bout.outstr("|#9Defaults: ");
    - 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("|#6No directories available.
  • From Xenos #1@60.Wwivnet@11:1/101 to Xenos #1 on Sat Dec 27 11:01:13 2025

    On Saturday,December 27, 2025 at 04:57 PM, Xenos wrote:

    + 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;

    I'm revising this to shorter code below:

    case 'L':
    a()->user()->data.lp_options ^= cfl_enable;
    break;

    Isn't that neat? :)

    Gotta hunt similar code and reduce to this form too.

    -=<(xenos)>=-


    A .-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
    /*\ ] /\liens' /\lcove! WWIV on Linux, Taguig, Metro Manila, Philippines [
    / v \`-=-=-=-=-=-=-=-=-=-=-=-[ WWIV Development ]-=-=--=-=-=-=-=-=-=-=-=-=-'

    ÿÿÿÿÿÿÿÿÿÿÿ
    --- WWIVToss v.1.52
    * Origin: http://www.weather-station.org * Bel Air, MD -USA (11:1/101.0)