This commit is contained in:
2026-03-04 15:47:38 -08:00
commit 781b4d19d4
9 changed files with 311 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
using System.Numerics;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
public class AllRooms
{
public Dictionary<string, Room> roomList { get; private set; } = new Dictionary<string, Room>();
public async Task PopulateRooms()
{
string result = await Query.Get("_matrix/client/r0/joined_rooms", true);
if (result != null)
{
JObject json = JObject.Parse(result);
JArray rooms = (JArray) json["joined_rooms"];
foreach (string internalID in rooms)
{
//Console.WriteLine("Room: " + roomName);
var room = new Room(internalID);
await room.GetName();
roomList.Add(internalID, room);
}
}
}
}