diff --git a/src/custom_widgets/chat_widget.py b/src/custom_widgets/chat_widget.py index 2a1a4ec..9db1b33 100644 --- a/src/custom_widgets/chat_widget.py +++ b/src/custom_widgets/chat_widget.py @@ -302,6 +302,8 @@ class chat_list(Gtk.ListBox): tab.get_child().set_label(new_chat_name) tab.get_child().set_tooltip_text(new_chat_name) tab.chat_window.set_name(new_chat_name) + if os.path.exists(os.path.join(data_dir, "chats", old_chat_name)): + shutil.move(os.path.join(data_dir, "chats", old_chat_name), os.path.join(data_dir, "chats", new_chat_name)) def duplicate_chat(self, chat_name:str): new_chat_name = window.generate_numbered_name(_("Copy of {}").format(chat_name), [tab.chat_window.get_name() for tab in self.tab_list]) diff --git a/src/window.py b/src/window.py index 1fe38c9..f07d811 100644 --- a/src/window.py +++ b/src/window.py @@ -159,7 +159,7 @@ class AlpacaWindow(Adw.ApplicationWindow): if self.model_manager.verify_if_image_can_be_used(): attached_images.append(os.path.join(self.data_dir, "chats", current_chat.get_name(), message_id, name)) else: - attached_files[name] = content['type'] + attached_files[os.path.join(self.data_dir, "chats", current_chat.get_name(), message_id, name)] = content['type'] if not os.path.exists(os.path.join(self.data_dir, "chats", current_chat.get_name(), message_id)): os.makedirs(os.path.join(self.data_dir, "chats", current_chat.get_name(), message_id)) shutil.copy(content['path'], os.path.join(self.data_dir, "chats", current_chat.get_name(), message_id, name))