gnello / php-openfire-restapi

A complete PHP client for the Openfire REST API Plugin.
Apache License 2.0
30 stars 14 forks source link

Retrieving not existing chat rooms returns response == 1 #11

Closed pavelsc closed 5 years ago

pavelsc commented 6 years ago

$response = $api->ChatRooms()->retrieveChatRoom('room_' . $e->data->id);

In case the room does not exist it returns an object with default values, but roomName, naturalName and description are 'room_78' for example. So to check the room exists I have to use workaround: if ($response['response'] == 1 && $response['output']->roomName !== $response['output']->naturalName) {

gnello commented 5 years ago

Hi pavelsc, I'm sorry for the delayed response.

I'm trying to replicate your issue on the 1.3.9 version of the REST API and all the responses I get are ["response"]=> bool(false) and ["output"]=> NULL.

Let me know if you still have problem with this.

gnello commented 5 years ago

Hi pavelsc, I don't know how but I found the time to update the client. I suggest you to point the version of this package in your composer.json to the 3.0.0 and run composer update.

I streamlined the code, so you'll probably have to change something, read the README.

I close the issue but feel free to reopen it if something's wrong.