Skip to content

Commit

Permalink
After using (B) to bypass a sub (from the reading prompt), don't ask …
Browse files Browse the repository at this point in the history
…if we want to post (#1437)

Fixes #1437
  • Loading branch information
wwiv committed Mar 26, 2021
1 parent 687a5c1 commit d48daed
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
3 changes: 2 additions & 1 deletion bbs/bbslist.cpp
Expand Up @@ -43,9 +43,10 @@

#include "common/output.h"

// ReSharper disable once CppUnusedIncludeDirective
#include <cereal/archives/json.hpp>
#include <cereal/types/memory.hpp>
// ReSharper disable once CppUnusedIncludeDirective
#include <cereal/types/memory.hpp>

using wwiv::common::InputMode;
using namespace wwiv::core;
Expand Down
6 changes: 5 additions & 1 deletion bbs/msgscan.cpp
Expand Up @@ -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{};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
34 changes: 16 additions & 18 deletions bbs/netsup.cpp
Expand Up @@ -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());
Expand All @@ -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()) {
Expand Down Expand Up @@ -645,7 +646,7 @@ static std::pair<int, int> 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++;
Expand Down Expand Up @@ -729,38 +730,35 @@ static std::pair<int, int> 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);
}
6 changes: 3 additions & 3 deletions bbs/sysopf.cpp
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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 << ")";

Expand All @@ -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();
Expand Down

0 comments on commit d48daed

Please sign in to comment.