diff --git a/README.md b/README.md index 4d92518..a2255e0 100644 --- a/README.md +++ b/README.md @@ -576,7 +576,7 @@ I used ideas and snippets from other responder bots and want to call them out! - **mikecarper**: ideas, and testing. hamtest - **c.merphy360**: high altitude alerts - **Iris**: testing and finding 🐞 -- **Cisien, bitflip, Woof, propstg, trs2982, Josh, mesb1, and Hailo1999**: For testing and feature ideas on Discord and GitHub. +- **Cisien, bitflip, Woof, propstg, snydermesh, trs2982, Josh, mesb1, and Hailo1999**: For testing and feature ideas on Discord and GitHub. - **Meshtastic Discord Community**: For tossing out ideas and testing code. ### Tools diff --git a/config.template b/config.template index 35c888f..73f0245 100644 --- a/config.template +++ b/config.template @@ -80,6 +80,7 @@ rawLLMQuery = True # StoreForward Enabled and Limits StoreForward = True StoreLimit = 3 +reverseSF = False # history command enableCmdHistory = True diff --git a/mesh_bot.py b/mesh_bot.py index 19c97a4..5fdc5cb 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1118,6 +1118,15 @@ def handle_messages(message, deviceID, channel_number, msg_history, publicChanne else: response += new_line + #remove extra new line + response = response.lstrip("\n") + + if reverseSF: + # segassem reverse the order of the messages + response_lines = response.split("\n") + response_lines.reverse() + response = "\n".join(response_lines) + if len(response) > 0: return header + response else: diff --git a/modules/settings.py b/modules/settings.py index e89d381..ea71ea8 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -214,6 +214,7 @@ try: urlTimeoutSeconds = config['general'].getint('urlTimeout', 10) # default 10 seconds store_forward_enabled = config['general'].getboolean('StoreForward', True) storeFlimit = config['general'].getint('StoreLimit', 3) # default 3 messages for S&F + reverseSF = config['general'].getboolean('reverseSF', False) # default False, send oldest first welcome_message = config['general'].get('welcome_message', WELCOME_MSG) welcome_message = (f"{welcome_message}").replace('\\n', '\n') # allow for newlines in the welcome message motd_enabled = config['general'].getboolean('motdEnabled', True) diff --git a/modules/system.py b/modules/system.py index 20afe53..15902fc 100644 --- a/modules/system.py +++ b/modules/system.py @@ -38,7 +38,7 @@ def cleanup_memory(): if 'cmdHistory' in globals() and len(cmdHistory) > MAX_CMD_HISTORY: cmdHistory = cmdHistory[-(MAX_CMD_HISTORY - 50):] # keep the most recent 50 entries logger.debug(f"System: Trimmed cmdHistory to {len(cmdHistory)} entries") - + # Clean up old seenNodes entries if 'seenNodes' in globals(): initial_count = len(seenNodes)