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/tell.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/tell.py') diff --git a/plugins/tell.py b/plugins/tell.py index 2b3eb0ce..ba638e82 100644 --- a/plugins/tell.py +++ b/plugins/tell.py @@ -20,6 +20,7 @@ This plugin defines two new commands for MUC tabs: :term:`/tell` and :term:`/unt """ from poezio.plugin import BasePlugin +from poezio.core.structs import Completion from poezio.decorators import command_args_parser from poezio import tabs @@ -77,6 +78,6 @@ class Plugin(BasePlugin): def completion_untell(self, the_input): tab = self.api.current_tab() if not tab in self.tabs: - return the_input.auto_completion([], '') - return the_input.auto_completion(list(self.tabs[tab]), '', quotify=False) + return Completion(the_input.auto_completion, [], '') + return Completion(the_input.auto_completion, list(self.tabs[tab]), '', quotify=False) -- cgit v1.2.3