summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-26 18:51:00 +0200
committermathieui <mathieui@mathieui.net>2020-05-26 18:51:00 +0200
commit5cf90368c66e0ccc3a93e51911f8fa82b496e02b (patch)
tree520680aa63ec4b45fcc3a08c8b23623839aa17f2 /plugins
parenta8d58a40e3ae7f41d43c8561228cd6cf822c7b95 (diff)
parent01e3169d43e1c8783cf13f37e1338776943e14c1 (diff)
downloadpoezio-5cf90368c66e0ccc3a93e51911f8fa82b496e02b.tar.gz
poezio-5cf90368c66e0ccc3a93e51911f8fa82b496e02b.tar.bz2
poezio-5cf90368c66e0ccc3a93e51911f8fa82b496e02b.tar.xz
poezio-5cf90368c66e0ccc3a93e51911f8fa82b496e02b.zip
Merge branch 'display-corrections-ui-types' into 'master'
plugins/display_corrections: Adapt to new poezio.ui API See merge request poezio/poezio!129
Diffstat (limited to 'plugins')
-rw-r--r--plugins/display_corrections.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/display_corrections.py b/plugins/display_corrections.py
index 99982ec9..69df154f 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.ui.consts import SHORT_FORMAT
class Plugin(BasePlugin):
@@ -44,6 +46,8 @@ class Plugin(BasePlugin):
if not messages:
return None
for message in reversed(messages):
+ if not isinstance(message, Message):
+ continue
if message.old_message:
if nb == 1:
return message
@@ -64,8 +68,9 @@ class Plugin(BasePlugin):
if message:
display = []
while message:
+ str_time = message.time.strftime(SHORT_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