working good state

This commit is contained in:
Tim Bendt
2025-05-01 11:59:28 -04:00
parent 7a5b911414
commit 1f75a03553
20 changed files with 173 additions and 78 deletions

View File

@@ -15,7 +15,7 @@ def action_next(app) -> None:
"""Show the next email message by finding the next higher ID from the list of envelope IDs."""
try:
result = subprocess.run(
["himalaya", "envelope", "list", "-o", "json"],
["himalaya", "envelope", "list", "-o", "json", "-s", "9999"],
capture_output=True,
text=True
)
@@ -23,13 +23,13 @@ def action_next(app) -> None:
import json
envelopes = json.loads(result.stdout)
ids = sorted(int(envelope['id']) for envelope in envelopes)
for index, envelope_id in enumerate(ids):
for envelope_id in ids:
if envelope_id > int(app.current_message_id):
app.show_message(envelope_id)
return
app.show_status("No newer messages found.", severity="warning")
app.show_message(envelopes[-1]['id']) # Automatically show the previous message
app.action_newest()
else:
app.show_status("Failed to fetch envelope list.", severity="error")
except Exception as e: