From 84e59b05ff0a17178da9ecdb6c5d084e48b42763 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 21 Aug 2016 15:27:53 +0200 Subject: =?UTF-8?q?Don=E2=80=99t=20call=20input=20completion()=20functions?= =?UTF-8?q?=20inside=20completion=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a placeholder object that can run it afterwards, so that we don’t have side effects inside those functions. --- plugins/send_delayed.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/send_delayed.py') diff --git a/plugins/send_delayed.py b/plugins/send_delayed.py index 8c536ea8..299de6e2 100644 --- a/plugins/send_delayed.py +++ b/plugins/send_delayed.py @@ -19,6 +19,7 @@ This plugin adds a command to the chat tabs. """ from poezio.plugin import BasePlugin +from poezio.core.structs import Completion from poezio.decorators import command_args_parser from poezio import tabs from poezio import common @@ -54,7 +55,7 @@ class Plugin(BasePlugin): if txt.endswith(' '): n += 1 if n == 2: - return the_input.auto_completion(["60", "5m", "15m", "30m", "1h", "10h", "1d"], '') + return Completion(the_input.auto_completion, ["60", "5m", "15m", "30m", "1h", "10h", "1d"], '') def say(self, args=None): if not args: -- cgit v1.2.3