From d85b7f42a7ac98c4b3040d26eb3f977e82faea0d Mon Sep 17 00:00:00 2001 From: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Date: Thu, 13 Mar 2025 20:21:37 -0700 Subject: [PATCH 1/2] Enable store and forward on default --- src/modules/StoreForwardModule.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/StoreForwardModule.cpp b/src/modules/StoreForwardModule.cpp index 0a6e1b4c4..91aa8faa5 100644 --- a/src/modules/StoreForwardModule.cpp +++ b/src/modules/StoreForwardModule.cpp @@ -338,8 +338,6 @@ void StoreForwardModule::sendErrorTextMessage(NodeNum dest, bool want_response) const char *str; if (this->busy) { str = "S&F - Busy. Try again shortly."; - } else { - str = "S&F not permitted on the public channel."; } LOG_WARN("%s", str); memcpy(pr->decoded.payload.bytes, str, strlen(str)); @@ -392,7 +390,7 @@ ProcessMessage StoreForwardModule::handleReceived(const meshtastic_MeshPacket &m LOG_DEBUG("Legacy Request to send"); // Send the last 60 minutes of messages. - if (this->busy || channels.isDefaultChannel(mp.channel)) { + if (this->busy) { sendErrorTextMessage(getFrom(&mp), mp.decoded.want_response); } else { storeForwardModule->historySend(historyReturnWindow * 60, getFrom(&mp)); @@ -457,7 +455,7 @@ bool StoreForwardModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, requests_history++; LOG_INFO("Client Request to send HISTORY"); // Send the last 60 minutes of messages. - if (this->busy || channels.isDefaultChannel(mp.channel)) { + if (this->busy) { sendErrorTextMessage(getFrom(&mp), mp.decoded.want_response); } else { if ((p->which_variant == meshtastic_StoreAndForward_history_tag) && (p->variant.history.window > 0)) { From e6fee598a39a24badf987668e1385f4a5ef16c4f Mon Sep 17 00:00:00 2001 From: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Date: Sun, 16 Mar 2025 10:47:05 -0700 Subject: [PATCH 2/2] Fix: initializer the error text variable --- src/modules/StoreForwardModule.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/StoreForwardModule.cpp b/src/modules/StoreForwardModule.cpp index 91aa8faa5..361e8a592 100644 --- a/src/modules/StoreForwardModule.cpp +++ b/src/modules/StoreForwardModule.cpp @@ -338,6 +338,8 @@ void StoreForwardModule::sendErrorTextMessage(NodeNum dest, bool want_response) const char *str; if (this->busy) { str = "S&F - Busy. Try again shortly."; + } else { + str = "S&F - Error. Channel not available."; } LOG_WARN("%s", str); memcpy(pr->decoded.payload.bytes, str, strlen(str));