about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-06-26 02:43:54 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-06-27 17:43:00 +0200
commit3ed00f732a284b5a3e96e52d4e3a71869135869b (patch)
tree308cdd5c9891a676dc55cbf0e0e998ab5a74b2d2 /MatrixRoomUtils.Core/Interfaces/IHomeServer.cs
parentWorking state, refactored Rory&::LibMatrix (diff)
downloadMatrixUtils-3ed00f732a284b5a3e96e52d4e3a71869135869b.tar.xz
Dependency injection stuff
Diffstat (limited to 'MatrixRoomUtils.Core/Interfaces/IHomeServer.cs')
-rw-r--r--MatrixRoomUtils.Core/Interfaces/IHomeServer.cs20
1 files changed, 0 insertions, 20 deletions
diff --git a/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs b/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs
index fcff0f2..029530c 100644
--- a/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs
+++ b/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs
@@ -20,22 +20,6 @@ public class IHomeServer {
     }
 
     private async Task<string> _resolveHomeserverFromWellKnown(string homeserver) {
-        if (RuntimeCache.HomeserverResolutionCache.Count == 0) {
-            // Console.WriteLine("No cached homeservers, resolving...");
-            await Task.Delay(Random.Shared.Next(1000, 5000));
-        }
-
-        if (RuntimeCache.HomeserverResolutionCache.ContainsKey(homeserver)) {
-            if (RuntimeCache.HomeserverResolutionCache[homeserver].ResolutionTime < DateTime.Now.AddHours(1)) {
-                Console.WriteLine($"Found cached homeserver: {RuntimeCache.HomeserverResolutionCache[homeserver].Result}");
-                return RuntimeCache.HomeserverResolutionCache[homeserver].Result;
-            }
-
-            Console.WriteLine($"Cached homeserver expired, removing: {RuntimeCache.HomeserverResolutionCache[homeserver].Result}");
-            RuntimeCache.HomeserverResolutionCache.Remove(homeserver);
-        }
-        //throw new NotImplementedException();
-
         string result = null;
         Console.WriteLine($"Resolving homeserver: {homeserver}");
         if (!homeserver.StartsWith("http")) homeserver = "https://" + homeserver;
@@ -67,10 +51,6 @@ public class IHomeServer {
 
         if (result != null) {
             Console.WriteLine($"Resolved homeserver: {homeserver} -> {result}");
-            RuntimeCache.HomeserverResolutionCache.TryAdd(homeserver, new HomeServerResolutionResult {
-                Result = result,
-                ResolutionTime = DateTime.Now
-            });
             return result;
         }