about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/RuntimeCache.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-03 18:40:53 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-03 18:40:53 +0200
commit3d3edeae16252a311704b390cfad6faa435a8b84 (patch)
tree34974194435fbe9789de5140ef9a9c0ddb834c74 /MatrixRoomUtils.Core/RuntimeCache.cs
parentAdd policy room discovery ,add room state viewer (diff)
downloadMatrixUtils-3d3edeae16252a311704b390cfad6faa435a8b84.tar.xz
Refactor
Diffstat (limited to 'MatrixRoomUtils.Core/RuntimeCache.cs')
-rw-r--r--MatrixRoomUtils.Core/RuntimeCache.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Core/RuntimeCache.cs b/MatrixRoomUtils.Core/RuntimeCache.cs
new file mode 100644

index 0000000..45262db --- /dev/null +++ b/MatrixRoomUtils.Core/RuntimeCache.cs
@@ -0,0 +1,29 @@ +using MatrixRoomUtils.Authentication; +using MatrixRoomUtils.Responses; + +namespace MatrixRoomUtils; + +public class RuntimeCache +{ + public static bool WasLoaded = false; + public static string AccessToken { get; set; } + public static string? CurrentHomeserver { get; set; } + public static AuthenticatedHomeServer CurrentHomeServer { get; set; } + public static Dictionary<string, UserInfo> LoginSessions { get; set; } = new(); + + public static Dictionary<string, HomeServerResolutionResult> HomeserverResolutionCache { get; set; } = new(); + public static Dictionary<string, (DateTime cachedAt, ProfileResponse response)> ProfileCache { get; set; } = new(); +} + + +public class UserInfo +{ + public ProfileResponse Profile { get; set; } = new(); + public LoginResponse LoginResponse { get; set; } +} + +public class HomeServerResolutionResult +{ + public string Result { get; set; } + public DateTime ResolutionTime { get; set; } +}