From 75cac0643927eaf16e2ccf237219e2ec9c766286 Mon Sep 17 00:00:00 2001 From: manetta Date: Thu, 6 May 2021 22:36:02 +0200 Subject: [PATCH] adding a hacky line to parse room names if they are defined as their full muc address... (debugging the @folder feature) --- LogBot/logbot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index 88f88f3..9554d19 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -165,7 +165,7 @@ class Logbot(Bot): if "stylesheet" not in self.db[room]: self.db[room]["stylesheet"] = "timeline" # default stylesheet if "font" not in self.db[room]: - self.db[room]["font"] = 'None' # default font + self.db[room]["font"] = 'none' # default font self.db._dumps() self.log.info(f"Added to the database: { room }") @@ -240,6 +240,8 @@ class Logbot(Bot): match = re.findall("@folder .*", message.content)[0] newfoldername = match.replace("@folder ", "") currentfoldername = self.db[message.room]["folder"] + if "@" in currentfoldername: # hacky + currentfoldername = self._parse_room_name(currentfoldername) os.rename(currentfoldername, newfoldername) self.db[message.room]["folder"] = newfoldername reply = f"The foldername of the log is changed to: { newfoldername }. The URL of the log changed into: https://vvvvvvaria.org/logs/{ newfoldername}"