aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-06-04 21:44:50 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-06-04 21:44:50 +0200
commit6d1e8945d34d451c5e6b2d0a34d771d325ab2519 (patch)
tree1c223d5b4bd1e2dcaf6c1352f1c9bd3f12eefd10 /wee_slack.py
parent6b067faa304a296f60da46c6b67142ae0bfa0eeb (diff)
downloadwee-slack-6d1e8945d34d451c5e6b2d0a34d771d325ab2519.tar.gz
Resolve relative paths for upload command
The tab completion for the upload command tab completes paths relative to weechat_dir, not the directory weechat was started from. Resolve the path given to the upload command to that directory, so tab completed relative paths work.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index e29b463..8f0f03e 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -4090,7 +4090,8 @@ def command_upload(data, current_buffer, args):
Uploads a file to the current buffer.
"""
channel = EVENTROUTER.weechat_controller.buffers[current_buffer]
- file_path = os.path.expanduser(args)
+ weechat_dir = w.info_get("weechat_dir", "")
+ file_path = os.path.join(weechat_dir, os.path.expanduser(args))
if channel.type == 'team':
w.prnt('', "ERROR: Can't upload a file to the team buffer")