Porting room

This commit is contained in:
Yoann Celton 2018-12-02 21:57:02 +11:00
commit 889c16363d
4 changed files with 904 additions and 9 deletions

View file

@ -93,7 +93,7 @@ class MatrixClient {
* A `User` object in this array is shared between all `Room`
* objects where the corresponding user is joined.
*/
protected $users = [];
public $users = [];
protected $userId;
protected $token;
protected $hs;
@ -423,7 +423,7 @@ class MatrixClient {
try {
$event = $this->api->getStateEvent($roomId, "m.room.encryption");
if ($event['algorithm'] === "m.megolm.v1.aes-sha2") {
$room->setEncrytion(true);
$room->enableEncryption();
}
} catch (MatrixRequestException $e) {
if ($e->getHttpCode() != 404) {
@ -528,4 +528,16 @@ class MatrixClient {
return true;
}
public function api(): MatrixHttpApi {
return $this->api;
}
public function userId():?string {
return $this->userId;
}
public function cacheLevel() {
return $this->cacheLevel;
}
}