summaryrefslogtreecommitdiff
path: root/plugins/display_corrections.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/display_corrections.py')
-rw-r--r--plugins/display_corrections.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/display_corrections.py b/plugins/display_corrections.py
index e9e8a2e4..cf8107ce 100644
--- a/plugins/display_corrections.py
+++ b/plugins/display_corrections.py
@@ -25,6 +25,8 @@ Usage
from poezio.plugin import BasePlugin
from poezio.common import shell_split
from poezio import tabs
+from poezio.ui.types import Message
+from poezio.theming import get_theme
class Plugin(BasePlugin):
@@ -43,7 +45,9 @@ class Plugin(BasePlugin):
messages = self.api.get_conversation_messages()
if not messages:
return None
- for message in messages[::-1]:
+ for message in reversed(messages):
+ if not isinstance(message, Message):
+ continue
if message.old_message:
if nb == 1:
return message
@@ -52,6 +56,7 @@ class Plugin(BasePlugin):
return None
def command_display_corrections(self, args):
+ theme = get_theme()
args = shell_split(args)
if len(args) == 1:
try:
@@ -64,8 +69,9 @@ class Plugin(BasePlugin):
if message:
display = []
while message:
+ str_time = message.time.strftime(theme.SHORT_TIME_FORMAT)
display.append('%s %s%s%s %s' %
- (message.str_time, '* '
+ (str_time, '* '
if message.me else '', message.nickname, ''
if message.me else '>', message.txt))
message = message.old_message