fix authorized remote message reads
Build web service image / build (push) Successful in 48s

This commit is contained in:
2026-09-21 11:18:09 +08:00
parent f8290a65bc
commit ab9ff389f2
7 changed files with 245 additions and 61 deletions
+4 -19
View File
@@ -98,25 +98,10 @@ public static partial class WechatChatClient
var selected = await OpenLocalSearchSessionAsync(window, name, cancellationToken, query).ConfigureAwait(false);
return new WechatSessionSnapshot(name, selected.AutomationId, true);
}
if (SafeName(FindByAutomationId(window, WechatLocators.CurrentChatName)) == name)
{
return new WechatSessionSnapshot(name, SafeAutomationId(FindByAutomationId(window, WechatLocators.CurrentChatName)!), true);
}
var target = FindByAutomationId(window, "session_item_" + name);
if (target is null)
{
var selected = await OpenLocalSearchSessionAsync(window, name, cancellationToken).ConfigureAwait(false);
return new WechatSessionSnapshot(name, selected.AutomationId, true);
}
ClickCenter(target);
if (!await WaitForSessionAsync(window, name, TimeSpan.FromSeconds(10), cancellationToken))
{
throw new WxAgentException(WxAgentErrorCode.ResultUnconfirmed, "The requested session did not become active.");
}
return new WechatSessionSnapshot(name, SafeAutomationId(target), true);
await OpenNamedSessionAsync(window, name, cancellationToken).ConfigureAwait(false);
var current = FindByAutomationId(window, WechatLocators.CurrentChatName);
var currentAutomationId = current is null ? null : SafeAutomationId(current);
return new WechatSessionSnapshot(name, currentAutomationId ?? "session_item_" + name, true);
}
finally
{