/**
  * @param integer $chatRoomId
  * @param string $chatRoomName
  * @param string $ownerName
  * @param array $membersIds
  * @param string $serviceName
  */
 public function createChatRoomWithSpecificMembersAndService($chatRoomId, $chatRoomName, $ownerName, $membersIds, $serviceName)
 {
     $ownerInfos = $ownerName . '@' . $serviceName . '.' . $this->config['servername'];
     $membersInfos = array_map(function ($memberId) {
         return $this->getUserJID($memberId);
     }, $membersIds);
     try {
         $this->client->request('post', '/chatrooms?servicename=' . $serviceName, array('roomName' => $chatRoomId, 'naturalName' => $chatRoomName, 'description' => $chatRoomName, 'owners' => array('owner' => $ownerInfos), 'members' => array('member' => $membersInfos), 'persistent' => true));
     } catch (RequestException $e) {
         throw new \Exception(self::REQUEST_ERROR_MESSAGE);
     }
 }
 /**
  * @param integer $chatRoomId
  * @param string $chatRoomName
  * @param array $membersIds
  * @param string $ownerName
  * @param string $serviceName
  */
 public function putChatRoomWithSpecificService($chatRoomId, $chatRoomName, $membersIds, $ownerName, $serviceName)
 {
     // TODO: For some reasons, the provided data is an
     // associative array sometimes, we change it into
     // a single array.
     $membersIds = array_values($membersIds);
     $membersNames = array_map(function ($memberId) {
         return $this->getUserJID($memberId);
     }, $membersIds);
     $ownerInfos = $ownerName . '@' . $serviceName . '.' . $this->config['servername'];
     $this->client->request('put', '/chatrooms/' . $chatRoomId . '?servicename=' . $serviceName, array('roomName' => $chatRoomId, 'naturalName' => $chatRoomName, 'description' => $chatRoomName, 'persistent' => true, 'members' => ['member' => $membersNames], 'owners' => ['owner' => $ownerInfos]));
 }