It didn't occur to me for some reason that reviewing messages would also add those messages to history lol. Hopefully fixed now.
This commit is contained in:
30
services.py
30
services.py
@@ -406,3 +406,33 @@ class SpeechHistoryService:
|
||||
int: Number of messages in history
|
||||
"""
|
||||
return len(self.history)
|
||||
|
||||
def is_at_first(self):
|
||||
"""Check if currently at the first (oldest) message in history.
|
||||
|
||||
Returns:
|
||||
bool: True if at the first message
|
||||
"""
|
||||
if not self.history:
|
||||
return False
|
||||
return self.current_index == 0
|
||||
|
||||
def is_at_last(self):
|
||||
"""Check if currently at the last (newest) message in history.
|
||||
|
||||
Returns:
|
||||
bool: True if at the last message or viewing most recent
|
||||
"""
|
||||
if not self.history:
|
||||
return False
|
||||
return self.current_index == -1 or self.current_index == len(self.history) - 1
|
||||
|
||||
def get_most_recent(self):
|
||||
"""Get the most recent message (what F2 should always say).
|
||||
|
||||
Returns:
|
||||
str or None: Most recent message text, or None if no history
|
||||
"""
|
||||
if not self.history:
|
||||
return None
|
||||
return self.history[-1]['text']
|
||||
|
Reference in New Issue
Block a user