From 478fc1b0ef855530e1e93c5212d154280f9d7dd8 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Tue, 24 Oct 2023 17:44:03 +0200 Subject: Minor cleanup --- LibMatrix/RoomTypes/GenericRoom.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'LibMatrix/RoomTypes/GenericRoom.cs') diff --git a/LibMatrix/RoomTypes/GenericRoom.cs b/LibMatrix/RoomTypes/GenericRoom.cs index d11b28d..1398f14 100644 --- a/LibMatrix/RoomTypes/GenericRoom.cs +++ b/LibMatrix/RoomTypes/GenericRoom.cs @@ -84,14 +84,9 @@ public class GenericRoom { } // TODO: should we even error handle here? - public async Task GetNameAsync() { - try { - var res = await GetStateAsync("m.room.name"); - return res?.Name ?? RoomId; - } - catch (MatrixException e) { - return $"{RoomId} ({e.ErrorCode})"; - } + public async Task GetNameAsync() { + var res = await GetStateAsync("m.room.name"); + return res?.Name; } public async Task JoinAsync(string[]? homeservers = null, string? reason = null) { @@ -285,4 +280,4 @@ public class GenericRoom { public class RoomIdResponse { [JsonPropertyName("room_id")] public string RoomId { get; set; } = null!; -} +} \ No newline at end of file -- cgit 1.4.1