summaryrefslogtreecommitdiff
path: root/plugins/send_delayed.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-21 15:27:53 +0200
committermathieui <mathieui@mathieui.net>2016-08-21 15:39:30 +0200
commit84e59b05ff0a17178da9ecdb6c5d084e48b42763 (patch)
tree224948d7c3d49a0005bff9390260357b3ec9c60e /plugins/send_delayed.py
parent6c270b363ac018dfd4d66b23af95efcc35610da0 (diff)
downloadpoezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.gz
poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.bz2
poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.tar.xz
poezio-84e59b05ff0a17178da9ecdb6c5d084e48b42763.zip
Don’t call input completion() functions inside completion methods
Use a placeholder object that can run it afterwards, so that we don’t have side effects inside those functions.
Diffstat (limited to 'plugins/send_delayed.py')
-rw-r--r--plugins/send_delayed.py3
1 files changed, 2 insertions, 1 deletions
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: