Skip to content

Commit c8c38de

Browse files
authored
feat: add hide_history_before option for adding members (#148)
1 parent 0bce506 commit c8c38de

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/GetStream/StreamChat/Channel.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace GetStream\StreamChat;
66

7+
use DateTime;
8+
79
/**
810
* Class for handling Stream Chat Channels
911
*/
@@ -299,6 +301,10 @@ public function addMembers(array $userIds, ?array $options = null): StreamRespon
299301
"add_members" => $userIds
300302
];
301303
if ($options !== null) {
304+
// Format hide_history_before DateTime to RFC 3339 if provided
305+
if (isset($options["hide_history_before"]) && $options["hide_history_before"] instanceof DateTime) {
306+
$options["hide_history_before"] = $options["hide_history_before"]->format(DateTime::RFC3339);
307+
}
302308
$payload = array_merge($payload, $options);
303309
}
304310
return $this->update(null, null, $payload);

0 commit comments

Comments
 (0)