From b4afcfaad880f035d31009fe0729fc0959353f26 Mon Sep 17 00:00:00 2001
From: Thomas Hackl <hackl@data-quest.de>
Date: Mon, 21 Mar 2022 16:04:59 +0100
Subject: [PATCH] convert Stud.IP username (LUH-ID) to lowercase

---
 controllers/matrix_chat.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/controllers/matrix_chat.php b/controllers/matrix_chat.php
index 4fa86ce..f80088b 100644
--- a/controllers/matrix_chat.php
+++ b/controllers/matrix_chat.php
@@ -61,7 +61,7 @@ class MatrixChatController extends AuthenticatedController
             if (!$this->account && !Config::get()->MATRIX_AUTO_CREATE_ACCOUNTS) {
                 $this->account = new MatrixAccount();
                 $this->account->user_id = User::findCurrent()->id;
-                $this->account->matrix_account_id = '@' . User::findCurrent()->username . ':' .
+                $this->account->matrix_account_id = '@' . strtolower(User::findCurrent()->username) . ':' .
                     Config::get()->MATRIX_ACCOUNTS_LOCAL_PART;
                 $this->account->matrix_password = '';
                 $this->account->store();
-- 
GitLab