From 03b8ecca233f615d21287beed8e51bcad1914701 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 25 Mar 2026 12:59:09 +0000 Subject: [PATCH] refactor: use result.Parameters in DeepLinkHandler instead of re-parsing query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DeepLinkParser.ParseDeepLink already parses the query string into result.Parameters (case-insensitive dictionary). The Handle method was calling GetQueryParam on the raw query string a second time for the 'send' and 'agent' cases — redundant work that also duplicated the parsing logic. Replace the GetQueryParam calls with result.Parameters.GetValueOrDefault and remove the now-unused `query` local variable. No behaviour change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/OpenClaw.Tray.WinUI/Services/DeepLinkHandler.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/OpenClaw.Tray.WinUI/Services/DeepLinkHandler.cs b/src/OpenClaw.Tray.WinUI/Services/DeepLinkHandler.cs index f9ffa85..646d4a9 100644 --- a/src/OpenClaw.Tray.WinUI/Services/DeepLinkHandler.cs +++ b/src/OpenClaw.Tray.WinUI/Services/DeepLinkHandler.cs @@ -50,7 +50,6 @@ public static void Handle(string uri, DeepLinkActions actions) return; var path = result.Path; - var query = result.Query; Logger.Info($"Handling deep link: {path}"); @@ -74,12 +73,12 @@ public static void Handle(string uri, DeepLinkActions actions) break; case "send": - var sendMessage = OpenClaw.Shared.DeepLinkParser.GetQueryParam(query, "message"); + var sendMessage = result.Parameters.GetValueOrDefault("message"); actions.OpenQuickSend?.Invoke(sendMessage); break; case "agent": - var agentMessage = OpenClaw.Shared.DeepLinkParser.GetQueryParam(query, "message"); + var agentMessage = result.Parameters.GetValueOrDefault("message"); if (!string.IsNullOrEmpty(agentMessage) && actions.SendMessage != null) { _ = Task.Run(async () =>