From b1b101fd98c8b4354a4e0c73e867d817466de30e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 11 Sep 2025 13:19:21 +0200 Subject: sync, rooms, events, etc --- src/Support/Parser.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/Support/Parser.php') diff --git a/src/Support/Parser.php b/src/Support/Parser.php index d850de1..02ec251 100644 --- a/src/Support/Parser.php +++ b/src/Support/Parser.php @@ -4,10 +4,10 @@ namespace App\Support; class Parser { - /** - * @return array - */ - public static function parseUser(string $user): array + /** + * @return array + */ + public static function parseUser(string $user): array { $username = $user; $server = ""; @@ -24,4 +24,22 @@ class Parser "server" => $server, ]; } + + /** + * @return array + */ + public static function parseRoomAlias(string $alias): array + { + $name = ""; + $server = ""; + + $parts = explode(":", $alias); + $name = substr($parts[0], 1); + $server = $parts[1]; + + return [ + "name" => $name, + "server" => $server, + ]; + } } -- cgit v1.2.3