about summary refs log tree commit diff
path: root/LibMatrix/Homeservers
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-12-23 08:54:11 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-12-23 08:54:11 +0100
commit14bcb748a853f7cd2afce40477bd2b0cb14ad7e6 (patch)
tree16dc78593288d715c93b5aee2903318c15a3e201 /LibMatrix/Homeservers
parentCleanup (diff)
downloadLibMatrix-14bcb748a853f7cd2afce40477bd2b0cb14ad7e6.tar.xz
User impersonation support (appservice identity assertion), non-AsyncEnumerable room member lookup
Diffstat (limited to '')
-rw-r--r--LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
index cf85287..73cd641 100644
--- a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
+++ b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
@@ -307,4 +307,9 @@ public class AuthenticatedHomeserverGeneric(string serverName, string accessToke
     }
 
     #endregion
+    
+    public async Task SetImpersonate(string mxid) {
+        ClientHttpClient.AdditionalQueryParameters["user_id"] = mxid;
+        WhoAmI = await ClientHttpClient.GetFromJsonAsync<WhoAmIResponse>("/_matrix/client/v3/account/whoami");
+    }
 }