Skip to content

Commit 9eeaa8f

Browse files
author
Rafael Marinho
committed
feat(CHA-769): support shared locations
1 parent 4fadc8b commit 9eeaa8f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/GetStream/StreamChat/Client.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,4 +1659,26 @@ public function queryDrafts(string $userId, ?array $filter = null, ?array $sort
16591659

16601660
return $this->post("drafts/query", $data);
16611661
}
1662+
1663+
/**
1664+
* Get a user active live locations
1665+
* @link https://getstream.io/chat/docs/php/live-locations/?language=php#get-a-user-active-live-locations
1666+
* @throws StreamException
1667+
*/
1668+
public function getUserActiveLiveLocations(string $userId): StreamResponse
1669+
{
1670+
$params = ["user_id" => $userId];
1671+
return $this->client->get($this->getUrl() . "/users/live_locations", $params);
1672+
}
1673+
1674+
/**
1675+
* Update a user active live location
1676+
* @link https://getstream.io/chat/docs/php/live-locations/?language=php#update-a-user-active-live-location
1677+
* @throws StreamException
1678+
*/
1679+
public function updateUserActiveLiveLocation(string $userId, array $location): StreamResponse
1680+
{
1681+
$params = ["user_id" => $userId, "message_id" => $messageId, "shared_location" => $location];
1682+
return $this->client->post($this->getUrl() . "/users/live_locations", $params);
1683+
}
16621684
}

0 commit comments

Comments
 (0)