Skip to content

Commit ab2339a

Browse files
committed
Bump to 0.5.3
1 parent accdb0c commit ab2339a

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased](https://github.com/pusher/chatkit-server-php/compare/0.5.2...HEAD)
7+
## [Unreleased](https://github.com/pusher/chatkit-server-php/compare/0.5.3...HEAD)
8+
9+
## [0.5.3](https://github.com/pusher/chatkit-server-php/compare/0.5.0...0.5.3) - 2018-06-11
10+
11+
### Additions
12+
13+
- `deleteRoom` functionality added [#19](https://github.com/pusher/chatkit-server-php/pull/19) by [@morrislaptop](https://github.com/morrislaptop)
14+
- `getUsers` functionality added [#20](https://github.com/pusher/chatkit-server-php/pull/20) by [@morrislaptop](https://github.com/morrislaptop)
815

916
## [0.5.2](https://github.com/pusher/chatkit-server-php/compare/0.5.0...0.5.2) - 2018-06-07
1017

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Or add to `composer.json`:
1414

1515
```json
1616
"require": {
17-
"pusher/pusher-chatkit-server": "^0.5.2"
17+
"pusher/pusher-chatkit-server": "^0.5.3"
1818
}
1919
```
2020

examples/get_users.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
require_once(dirname(__FILE__) . '/../vendor/autoload.php');
4+
5+
$chatkit = new Chatkit\Chatkit([
6+
'instance_locator' => 'your:instance:locator',
7+
'key' => 'your:key'
8+
]);
9+
10+
print_r($chatkit->getUsers());
11+
12+
// example with a from_ts parameter
13+
// print_r($chatkit->getUsers([ 'from_ts' => '2018-04-17T12:46:51Z' ]));

src/Chatkit.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,16 @@ public function createRoom($options)
279279
}
280280

281281
/**
282-
* Deletes a room give an room_id and user_id
282+
* Deletes a room given a room_id
283283
*/
284284
public function deleteRoom($options)
285285
{
286286
if (is_null($options['room_id'])) {
287287
throw new MissingArgumentException('You must provide the ID of the room that you wish to delete');
288288
}
289-
if (is_null($options['user_id'])) {
290-
throw new MissingArgumentException('You must provide the ID of the user that owns the room');
291-
}
292289

293290
$room_id = $options['room_id'];
294-
295-
$token = $this->getServerToken(['user_id' => $options['user_id']]);
291+
$token = $this->getServerToken();
296292

297293
$ch = $this->createCurl(
298294
$this->api_settings,
@@ -411,15 +407,15 @@ public function deleteUser($options)
411407
public function getUsers($options = [])
412408
{
413409
$token = $this->getServerToken();
410+
$path = '/users';
414411

415-
$query = '';
416412
if (!empty($options['from_ts'])) {
417-
$query = '?from_ts=' . $options['from_ts'];
413+
$path = $path . '?from_ts=' . $options['from_ts'];
418414
}
419415

420416
$ch = $this->createCurl(
421417
$this->api_settings,
422-
'/users' . $query,
418+
$path,
423419
$token,
424420
'GET'
425421
);

0 commit comments

Comments
 (0)