summary refs log tree commit diff
path: root/MxApiExtensions/Controllers
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-11-16 03:34:00 +0100
committerRory& <root@rory.gay>2024-11-16 03:34:00 +0100
commitec14ac1d3db8a9be10b94a98f408c087b1f7175c (patch)
tree1b11140090ad4d20ea0c4b41a95942d6c042b986 /MxApiExtensions/Controllers
parentUpdate dependencies (diff)
downloadMxApiExtensions-master.tar.xz
Update to .NET 9 HEAD master
Diffstat (limited to 'MxApiExtensions/Controllers')
-rw-r--r--MxApiExtensions/Controllers/Client/Room/RoomsSendMessageController.cs2
-rw-r--r--MxApiExtensions/Controllers/Client/SyncController.cs3
2 files changed, 2 insertions, 3 deletions
diff --git a/MxApiExtensions/Controllers/Client/Room/RoomsSendMessageController.cs b/MxApiExtensions/Controllers/Client/Room/RoomsSendMessageController.cs
index 369e7cc..4bd631e 100644
--- a/MxApiExtensions/Controllers/Client/Room/RoomsSendMessageController.cs
+++ b/MxApiExtensions/Controllers/Client/Room/RoomsSendMessageController.cs
@@ -62,7 +62,7 @@ public class RoomsSendMessageController(ILogger<LoginController> logger, UserCon
             TypedContent = MessageFormatter.FormatSuccess("Thinking..."),
             OriginServerTs = DateTimeOffset.Now.ToUnixTimeMilliseconds(),
             Unsigned = new() {
-                Age = 1
+                ["age"] = 1
             },
             RoomId = roomId,
             EventId = "$" + string.Join("", Random.Shared.GetItems("abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789".ToCharArray(), 100))
diff --git a/MxApiExtensions/Controllers/Client/SyncController.cs b/MxApiExtensions/Controllers/Client/SyncController.cs
index 6568d7e..3d88b77 100644
--- a/MxApiExtensions/Controllers/Client/SyncController.cs
+++ b/MxApiExtensions/Controllers/Client/SyncController.cs
@@ -222,7 +222,6 @@ public class SyncController(ILogger<SyncController> logger, MxApiExtensionsConfi
             if (dmRooms.Contains(x.RoomId)) return -1;
             var parts = x.RoomId.Split(':');
             if (parts[1] == ownHs) return 200;
-            if (HomeserverWeightEstimation.EstimatedSize.ContainsKey(parts[1])) return HomeserverWeightEstimation.EstimatedSize[parts[1]] + parts[0].Length;
             return 5000;
         }).ToList();
 
@@ -246,7 +245,7 @@ public class SyncController(ILogger<SyncController> logger, MxApiExtensionsConfi
         // await _roomDataSemaphore.WaitAsync();
         //get the room's state
         var roomState = room.GetFullStateAsync();
-        //get the room's timeline, reversed 
+        //get the room's timeline, reversed
         var timeline = await room.GetMessagesAsync(limit: 100, dir: "b");
         timeline.Chunk.Reverse();
         //queue up this data as a sync response