From a5b15eafe07a90eefec2ef63ead8bea3c96e0bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 9 Aug 2020 20:09:50 +0200 Subject: plugins/lastlog: adapt to use poezio.ui.types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/lastlog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/lastlog.py b/plugins/lastlog.py index 49efa522..70ea53c1 100644 --- a/plugins/lastlog.py +++ b/plugins/lastlog.py @@ -18,7 +18,7 @@ from datetime import datetime from poezio.plugin import BasePlugin from poezio import tabs from poezio.text_buffer import TextBuffer -from poezio.ui.types import InfoMessage +from poezio.ui.types import Message as PMessage, InfoMessage def add_line( @@ -52,7 +52,7 @@ class Plugin(BasePlugin): res = [] add_line(text_buffer, "Lastlog:") for message in text_buffer.messages: - if message.nickname is not None and \ + if isinstance(message, PMessage) and \ search_re.search(message.txt) is not None: res.append(message) add_line(text_buffer, "%s> %s" % (message.nickname, message.txt), message.time) -- cgit v1.2.3