about summary refs log tree commit diff
path: root/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs')
-rw-r--r--LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
index f6c530d..c78b799 100644
--- a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
+++ b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
@@ -39,7 +39,8 @@ public class AuthenticatedHomeserverGeneric(string baseUrl, string accessToken)
 
 
     public WhoAmIResponse? WhoAmI { get; set; }
-    public string UserId => WhoAmI.UserId;
+    public string? UserId => WhoAmI?.UserId;
+    public string? UserLocalpart => UserId?.Split(":")[0][1..];
 
     // public virtual async Task<WhoAmIResponse> WhoAmI() {
     // if (_whoAmI is not null) return _whoAmI;