Skip to content
Snippets Groups Projects
Commit 9a550aa5 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

use manual path

parent e35b7a20
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,13 @@ class MatrixChatController extends AuthenticatedController
// Check if current user has a Matrix account.
$this->account = MatrixAccount::find(User::findCurrent()->id);
// If no account is found, try to search in Matrix user directory.
$found = MatrixClient::get()->searchUsers(
MatrixAccount::requireSystemAccount(), '@studip_test1:', 1);
PageLayout::postInfo('<pre>' . print_r($found, 1) . '</pre>');
$this->no_account_wanted = UserConfig::get(User::findCurrent()->id)->MATRIX_NO_ACCOUNT_WANTED;
if ($this->account) {
......
......@@ -76,6 +76,14 @@ class InitMatrixChat extends Migration
'range' => 'global',
'section' => 'matrix',
'description' => 'URL des Chatservers (z.B. Element)'
],
'AUTO_CREATE_ACCOUNTS' => [
'value' => false,
'type' => 'bool',
'range' => 'global',
'section' => 'matrix',
'description' => 'Soll automatisch versucht werden, Matrixaccounts anzulegen? Andernfalls wird ' .
'ein Link zum Chatserver angezeigt.'
]
];
......
......@@ -29,7 +29,10 @@ class MatrixClient
public static function get()
{
if (is_null(MatrixClient::$client)) {
MatrixClient::$client = new Patrix\MatrixClient(Config::get()->MATRIX_SERVER_HOSTNAME);
MatrixClient::$client = new Patrix\MatrixClient(
Config::get()->MATRIX_SERVER_HOSTNAME,
'https://' . Config::get()->MATRIX_SERVER_HOSTNAME
);
}
return MatrixClient::$client;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment