reverse the order of the messages
This commit is contained in:
SpudGunMan
2025-10-09 17:21:07 -07:00
parent e8063fcf3f
commit f5f8539924
5 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -80,6 +80,7 @@ rawLLMQuery = True
# StoreForward Enabled and Limits
StoreForward = True
StoreLimit = 3
reverseSF = False
# history command
enableCmdHistory = True
+9
View File
@@ -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:
+1
View File
@@ -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)
+1 -1
View File
@@ -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)