From efbbeb73062cc0bee44d5ce615a323e5df79b5b9 Mon Sep 17 00:00:00 2001 From: StyxX65 <150797939+StyxX65@users.noreply.github.com> Date: Mon, 22 Jun 2026 15:43:46 +0200 Subject: [PATCH] Restore M365Connector.delete_message (was an orphaned method body) The def line for delete_message had been lost, leaving its body as unreachable dead code at the end of _delete() and no delete_message attribute on the connector. Deleting an Outlook message therefore failed with "'M365Connector' object has no attribute 'delete_message'". Restored the method (soft-delete: move to Deleted Items, fall back to DELETE). Co-Authored-By: Claude Opus 4.8 --- m365_connector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/m365_connector.py b/m365_connector.py index df5d982..210f259 100644 --- a/m365_connector.py +++ b/m365_connector.py @@ -552,6 +552,8 @@ class M365Connector: r.raise_for_status() return True # 204 No Content = success raise _requests.exceptions.RetryError(f"Gave up after {self._MAX_RETRIES} attempts: {url}") + + def delete_message(self, user_id: str, message_id: str) -> bool: """Move an email to Deleted Items (soft delete).""" base = "/me" if (not user_id or user_id == "me") else f"/users/{user_id}" try: