summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoutherntofu <southerntofu@thunix.net>2022-03-07 14:07:05 -0500
committersoutherntofu <southerntofu@thunix.net>2022-03-07 14:07:05 -0500
commit5d140947803f81c23de82554e4fba99b3c7e4156 (patch)
tree777288a2743b2b85ff68b61e55e8d60f30de5b20
parent0676cec53eec893030baf3df2a99baa2e5174607 (diff)
downloadpoezio-5d140947803f81c23de82554e4fba99b3c7e4156.tar.gz
poezio-5d140947803f81c23de82554e4fba99b3c7e4156.tar.bz2
poezio-5d140947803f81c23de82554e4fba99b3c7e4156.tar.xz
poezio-5d140947803f81c23de82554e4fba99b3c7e4156.zip
Don't silently traceback when trying to message someone privately in a MUC
Using jidstr with slashes "escaped" as backslashes is clever, but _check_and_create_log_dir still expects a parsable JID to check config.
-rw-r--r--poezio/logger.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/poezio/logger.py b/poezio/logger.py
index 21667924..85b861e1 100644
--- a/poezio/logger.py
+++ b/poezio/logger.py
@@ -196,6 +196,8 @@ class Logger:
"""
if not config.get_by_tabname('use_log', JID(jid)):
return None
+ # POSIX filesystems don't support / in filename, so we replace it with a backslash
+ jid = str(jid).replace('/', '\\')
try:
self.log_dir.mkdir(parents=True, exist_ok=True)
except OSError:
@@ -255,7 +257,7 @@ class Logger:
if jidstr in self._fds.keys():
fd = self._fds[jidstr]
else:
- option_fd = self._check_and_create_log_dir(jidstr)
+ option_fd = self._check_and_create_log_dir(jid)
if option_fd is None:
return True
fd = option_fd