diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-10-24 17:44:03 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-10-24 17:44:03 +0200 |
commit | 478fc1b0ef855530e1e93c5212d154280f9d7dd8 (patch) | |
tree | 3bb348b939f8d78e85337d49d3163ac5dbc8e8cc /LibMatrix/RoomTypes | |
parent | fix synchelper null check (diff) | |
download | LibMatrix-bak-478fc1b0ef855530e1e93c5212d154280f9d7dd8.tar.xz |
Minor cleanup
Diffstat (limited to 'LibMatrix/RoomTypes')
-rw-r--r-- | LibMatrix/RoomTypes/GenericRoom.cs | 13 |
1 files changed, 4 insertions, 9 deletions
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<string> GetNameAsync() { - try { - var res = await GetStateAsync<RoomNameEventContent>("m.room.name"); - return res?.Name ?? RoomId; - } - catch (MatrixException e) { - return $"{RoomId} ({e.ErrorCode})"; - } + public async Task<string?> GetNameAsync() { + var res = await GetStateAsync<RoomNameEventContent>("m.room.name"); + return res?.Name; } public async Task<RoomIdResponse> 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 |