diff --git a/bbs/bbslist.cpp b/bbs/bbslist.cpp index 6439a7671..5ce566aa0 100644 --- a/bbs/bbslist.cpp +++ b/bbs/bbslist.cpp @@ -43,9 +43,10 @@ #include "common/output.h" +// ReSharper disable once CppUnusedIncludeDirective #include -#include // ReSharper disable once CppUnusedIncludeDirective +#include using wwiv::common::InputMode; using namespace wwiv::core; diff --git a/bbs/msgscan.cpp b/bbs/msgscan.cpp index f1a53b72e..897730dee 100644 --- a/bbs/msgscan.cpp +++ b/bbs/msgscan.cpp @@ -1098,6 +1098,7 @@ static bool query_post() { static void scan_new(int msgnum, MsgScanOption scan_option, bool& nextsub, bool title_scan) { auto done = false; auto val = 0; + auto skip_query_post = false; while (!done) { a()->CheckForHangup(); ReadMessageResult result{}; @@ -1158,6 +1159,7 @@ static void scan_new(int msgnum, MsgScanOption scan_option, bool& nextsub, bool break; case 'B': if (nextsub) { + skip_query_post = true; HandleRemoveFromNewScan(); } nextsub = true; @@ -1206,7 +1208,9 @@ static void scan_new(int msgnum, MsgScanOption scan_option, bool& nextsub, bool if ((val & 2) && lcs()) { network_validate(); } - done = query_post(); + if (!skip_query_post) { + done = query_post(); + } if (!done) { // back to list title. scan_option = MsgScanOption::SCAN_OPTION_LIST_TITLES; diff --git a/bbs/netsup.cpp b/bbs/netsup.cpp index 4516e555a..084b40ffc 100644 --- a/bbs/netsup.cpp +++ b/bbs/netsup.cpp @@ -429,7 +429,7 @@ static std::string to_difftime_string(daten_t now, daten_t then) { } static void print_call(uint16_t sn, const net_networks_rec& net) { - static int color, got_color = 0; + static int color; auto now = daten_t_now(); Callout callout(net, a()->config()->max_backups()); @@ -445,8 +445,9 @@ static void print_call(uint16_t sn, const net_networks_rec& net) { return; } + static auto got_color = false; if (!got_color) { - got_color = 1; + got_color = true; IniFile ini(FilePath(a()->bbspath(), WWIV_INI), {StrCat("WWIV-", a()->sess().instance_number()), INI_TAG}); if (ini.IsOpen()) { @@ -645,7 +646,7 @@ static std::pair ansicallout() { } break; case DNARROW: // down arrow - if ((y < 5) && (pos + 10 < ssize(entries))) { + if (y < 5 && pos + 10 < ssize(entries)) { a()->localIO()->PutsXYA(6 + x, 5 + y, color4, fmt::sprintf("%-5u", entries[pos].node)); pos += 10; y++; @@ -729,38 +730,35 @@ static std::pair ansicallout() { } static int FindNetworkNumberForNode(int sn) { - for (auto nNetNumber = 0; nNetNumber < wwiv::stl::ssize(a()->nets()); nNetNumber++) { - const auto net = a()->nets()[nNetNumber]; - Callout callout(net, a()->config()->max_backups()); - if (callout.net_call_out_for(sn) != nullptr) { - return nNetNumber; + for (auto net_number = 0; net_number < wwiv::stl::ssize(a()->nets()); net_number++) { + const auto net = a()->nets()[net_number]; + if (Callout callout(net, a()->config()->max_backups()); callout.net_call_out_for(sn) != nullptr) { + return net_number; } } return -1; } void force_callout() { - const auto sn = ansicallout(); - if (sn.first <= 0) { + auto [system_number, network_number] = ansicallout(); + if (system_number <= 0) { return; } - - int network_number = sn.second; if (network_number < 0) { - network_number = FindNetworkNumberForNode(sn.first); - if (network_number < 0) { - return; - } + network_number = FindNetworkNumberForNode(system_number); + } + if (network_number < 0) { + return; } const auto& net = a()->nets()[network_number]; set_net_num(network_number); const Callout callout(net, a()->config()->max_backups()); - if (!allowed_to_call(*callout.net_call_out_for(sn.first), DateTime::now())) { + if (!allowed_to_call(*callout.net_call_out_for(system_number), DateTime::now())) { return; } a()->Cls(); - do_callout(net, sn.first); + do_callout(net, system_number); } diff --git a/bbs/sysopf.cpp b/bbs/sysopf.cpp index 36344fe10..0a26f9f6b 100644 --- a/bbs/sysopf.cpp +++ b/bbs/sysopf.cpp @@ -806,7 +806,7 @@ void mailr() { } } bout.nl(2); - } while ((c == 'R') && (!a()->sess().hangup())); + } while (c == 'R' && !a()->sess().hangup()); pFileEmail = OpenEmailFile(false); if (!pFileEmail->IsOpen()) { @@ -899,7 +899,7 @@ void auto_purge() { return; } - auto current_daten = daten_t_now(); + const auto current_daten = daten_t_now(); int user_number = 1; sysoplog(false) << "Auto-Purged Inactive Users (over " << days << " days, SL less than " << skipsl << ")"; @@ -920,7 +920,7 @@ void auto_purge() { } void beginday(bool displayStatus) { - if ((a()->GetBeginDayNodeNumber() > 0) + if (a()->GetBeginDayNodeNumber() > 0 && (a()->sess().instance_number() != a()->GetBeginDayNodeNumber())) { // If BEGINDAYNODENUMBER is > 0 or defined in WWIV.INI only handle beginday events on that node number a()->status_manager()->reload_status();