File tree 4 files changed +27
-11
lines changed 4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
5
5
and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
6
6
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 )
8
15
9
16
## [ 0.5.2] ( https://github.com/pusher/chatkit-server-php/compare/0.5.0...0.5.2 ) - 2018-06-07
10
17
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Or add to `composer.json`:
14
14
15
15
``` json
16
16
"require" : {
17
- "pusher/pusher-chatkit-server" : " ^0.5.2 "
17
+ "pusher/pusher-chatkit-server" : " ^0.5.3 "
18
18
}
19
19
```
20
20
Original file line number Diff line number Diff line change
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' ]));
Original file line number Diff line number Diff line change @@ -279,20 +279,16 @@ public function createRoom($options)
279
279
}
280
280
281
281
/**
282
- * Deletes a room give an room_id and user_id
282
+ * Deletes a room given a room_id
283
283
*/
284
284
public function deleteRoom ($ options )
285
285
{
286
286
if (is_null ($ options ['room_id ' ])) {
287
287
throw new MissingArgumentException ('You must provide the ID of the room that you wish to delete ' );
288
288
}
289
- if (is_null ($ options ['user_id ' ])) {
290
- throw new MissingArgumentException ('You must provide the ID of the user that owns the room ' );
291
- }
292
289
293
290
$ room_id = $ options ['room_id ' ];
294
-
295
- $ token = $ this ->getServerToken (['user_id ' => $ options ['user_id ' ]]);
291
+ $ token = $ this ->getServerToken ();
296
292
297
293
$ ch = $ this ->createCurl (
298
294
$ this ->api_settings ,
@@ -411,15 +407,15 @@ public function deleteUser($options)
411
407
public function getUsers ($ options = [])
412
408
{
413
409
$ token = $ this ->getServerToken ();
410
+ $ path = '/users ' ;
414
411
415
- $ query = '' ;
416
412
if (!empty ($ options ['from_ts ' ])) {
417
- $ query = '?from_ts= ' . $ options ['from_ts ' ];
413
+ $ path = $ path . '?from_ts= ' . $ options ['from_ts ' ];
418
414
}
419
415
420
416
$ ch = $ this ->createCurl (
421
417
$ this ->api_settings ,
422
- ' /users ' . $ query ,
418
+ $ path ,
423
419
$ token ,
424
420
'GET '
425
421
);
You can’t perform that action at this time.
0 commit comments