aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-05-06 07:28:39 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2021-05-11 22:17:40 +0200
commite06322d05af4e67c62585a5a7263e7b55e9238bb (patch)
tree558736c6587f4501a8b2c2a30d874f697615f11a /wee_slack.py
parentd933488b7272106a4720591673528ecdf4cef913 (diff)
downloadwee-slack-e06322d05af4e67c62585a5a7263e7b55e9238bb.tar.gz
Add compatibility with WeeChat >= 3.2 (XDG directories)
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 26be1a2..c77f2da 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -4038,7 +4038,10 @@ def download_files(message_json, channel):
download_location = config.files_download_location
if not download_location:
return
- download_location = w.string_eval_path_home(download_location, {}, {}, {})
+ options = {
+ "directory": "data",
+ }
+ download_location = w.string_eval_path_home(download_location, {}, {}, options)
if not os.path.exists(download_location):
try:
@@ -5819,7 +5822,7 @@ def command_upload(data, current_buffer, args):
Uploads a file to the current buffer.
"""
channel = EVENTROUTER.weechat_controller.buffers[current_buffer]
- weechat_dir = w.info_get("weechat_dir", "")
+ weechat_dir = w.info_get("weechat_data_dir", "") or w.info_get("weechat_dir", "")
file_path = os.path.join(weechat_dir, os.path.expanduser(args))
if channel.type == "team":
@@ -6086,7 +6089,9 @@ def create_slack_debug_buffer():
def load_emoji():
try:
- weechat_dir = w.info_get("weechat_dir", "")
+ weechat_dir = w.info_get("weechat_data_dir", "") or w.info_get(
+ "weechat_dir", ""
+ )
weechat_sharedir = w.info_get("weechat_sharedir", "")
local_weemoji, global_weemoji = (
"{}/weemoji.json".format(path) for path in (weechat_dir, weechat_sharedir)