From f82adb677bd0286d8f81cf17a8e78bb37f05439e Mon Sep 17 00:00:00 2001 From: Marius Kleidl Date: Wed, 5 Nov 2025 09:20:58 +0100 Subject: [PATCH] feat: add hide_history_before option for adding members --- lib/GetStream/StreamChat/Channel.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/GetStream/StreamChat/Channel.php b/lib/GetStream/StreamChat/Channel.php index ac5b0e2..5b7e152 100644 --- a/lib/GetStream/StreamChat/Channel.php +++ b/lib/GetStream/StreamChat/Channel.php @@ -4,6 +4,8 @@ namespace GetStream\StreamChat; +use DateTime; + /** * Class for handling Stream Chat Channels */ @@ -299,6 +301,10 @@ public function addMembers(array $userIds, ?array $options = null): StreamRespon "add_members" => $userIds ]; if ($options !== null) { + // Format hide_history_before DateTime to RFC 3339 if provided + if (isset($options["hide_history_before"]) && $options["hide_history_before"] instanceof DateTime) { + $options["hide_history_before"] = $options["hide_history_before"]->format(DateTime::RFC3339); + } $payload = array_merge($payload, $options); } return $this->update(null, null, $payload);