init
This commit is contained in:
+25
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user