From 9f933f21009b7f34d71f1f71b8fce9a8edf9f8d2 Mon Sep 17 00:00:00 2001 From: overtrue Date: Thu, 30 Nov 2023 22:21:07 +0800 Subject: [PATCH] fix: event key #2760 --- src/Kernel/Traits/InteractWithHttpClient.php | 1 + src/Work/Server.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Kernel/Traits/InteractWithHttpClient.php b/src/Kernel/Traits/InteractWithHttpClient.php index 518b77814..44476f21c 100644 --- a/src/Kernel/Traits/InteractWithHttpClient.php +++ b/src/Kernel/Traits/InteractWithHttpClient.php @@ -10,6 +10,7 @@ use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\HttpClient\ScopingHttpClient; use Symfony\Contracts\HttpClient\HttpClientInterface; + use function property_exists; trait InteractWithHttpClient diff --git a/src/Work/Server.php b/src/Work/Server.php index 4d8722a56..30519144f 100644 --- a/src/Work/Server.php +++ b/src/Work/Server.php @@ -148,7 +148,7 @@ public function handleUserDeleted(callable $handler): static public function handlePartyCreated(callable $handler): static { $this->with(function (Message $message, Closure $next) use ($handler): mixed { - return $message->InfoType === 'change_contact' && $message->ChangeType === 'create_party' ? $handler( + return $message->Event === 'change_contact' && $message->ChangeType === 'create_party' ? $handler( $message, $next ) : $next($message); @@ -163,7 +163,7 @@ public function handlePartyCreated(callable $handler): static public function handlePartyUpdated(callable $handler): static { $this->with(function (Message $message, Closure $next) use ($handler): mixed { - return $message->InfoType === 'change_contact' && $message->ChangeType === 'update_party' ? $handler( + return $message->Event === 'change_contact' && $message->ChangeType === 'update_party' ? $handler( $message, $next ) : $next($message); @@ -178,7 +178,7 @@ public function handlePartyUpdated(callable $handler): static public function handlePartyDeleted(callable $handler): static { $this->with(function (Message $message, Closure $next) use ($handler): mixed { - return $message->InfoType === 'change_contact' && $message->ChangeType === 'delete_party' ? $handler( + return $message->Event === 'change_contact' && $message->ChangeType === 'delete_party' ? $handler( $message, $next ) : $next($message);