diff --git a/MatrixDotNetLib/.vs/MatrixDotNetLib/DesignTimeBuild/.dtbcache.v2 b/MatrixDotNetLib/.vs/MatrixDotNetLib/DesignTimeBuild/.dtbcache.v2 index 6db9b81..0fedc34 100644 Binary files a/MatrixDotNetLib/.vs/MatrixDotNetLib/DesignTimeBuild/.dtbcache.v2 and b/MatrixDotNetLib/.vs/MatrixDotNetLib/DesignTimeBuild/.dtbcache.v2 differ diff --git a/MatrixDotNetLib/.vs/MatrixDotNetLib/v16/.suo b/MatrixDotNetLib/.vs/MatrixDotNetLib/v16/.suo index 270ee95..a503216 100644 Binary files a/MatrixDotNetLib/.vs/MatrixDotNetLib/v16/.suo and b/MatrixDotNetLib/.vs/MatrixDotNetLib/v16/.suo differ diff --git a/MatrixDotNetLib/MatrixDotNetCmd/Program.cs b/MatrixDotNetLib/MatrixDotNetCmd/Program.cs index fa248df..5a12741 100644 --- a/MatrixDotNetLib/MatrixDotNetCmd/Program.cs +++ b/MatrixDotNetLib/MatrixDotNetCmd/Program.cs @@ -1,4 +1,6 @@ using System; +using MatrixDotNetLib; +using Newtonsoft.Json; namespace MatrixDotNetCmd { @@ -6,7 +8,14 @@ namespace MatrixDotNetCmd { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + Console.WriteLine("MatrixDotNetLib v0.1 - A .NET Core library for Matrix"); + + // let's just try a thing + MatrixSessionManager session = new MatrixSessionManager(); + + MatrixLoginResponse response = session.Login("post.hyrule.cc", "claire", "B52Lorelai"); + + Console.WriteLine(JsonConvert.SerializeObject(response)); } } } diff --git a/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.assets.cache b/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.assets.cache index e5ed04c..9c7f5c4 100644 Binary files a/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.assets.cache and b/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.assets.cache differ diff --git a/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.csprojAssemblyReference.cache b/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.csprojAssemblyReference.cache index 1c77b69..a87cc16 100644 Binary files a/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.csprojAssemblyReference.cache and b/MatrixDotNetLib/MatrixDotNetCmd/obj/Debug/netcoreapp3.1/MatrixDotNetCmd.csprojAssemblyReference.cache differ diff --git a/MatrixDotNetLib/MatrixDotNetCmd/obj/MatrixDotNetCmd.csproj.nuget.dgspec.json b/MatrixDotNetLib/MatrixDotNetCmd/obj/MatrixDotNetCmd.csproj.nuget.dgspec.json index a8c0497..587b306 100644 --- a/MatrixDotNetLib/MatrixDotNetCmd/obj/MatrixDotNetCmd.csproj.nuget.dgspec.json +++ b/MatrixDotNetLib/MatrixDotNetCmd/obj/MatrixDotNetCmd.csproj.nuget.dgspec.json @@ -93,6 +93,12 @@ }, "frameworks": { "netcoreapp3.1": { + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, "imports": [ "net461", "net462", diff --git a/MatrixDotNetLib/MatrixDotNetCmd/obj/project.assets.json b/MatrixDotNetLib/MatrixDotNetCmd/obj/project.assets.json index 8febbbe..1c11148 100644 --- a/MatrixDotNetLib/MatrixDotNetCmd/obj/project.assets.json +++ b/MatrixDotNetLib/MatrixDotNetCmd/obj/project.assets.json @@ -2,9 +2,21 @@ "version": 3, "targets": { ".NETCoreApp,Version=v3.1": { + "Newtonsoft.Json/12.0.3": { + "type": "package", + "compile": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + } + }, "MatrixDotNetLib/1.0.0": { "type": "project", "framework": ".NETCoreApp,Version=v3.1", + "dependencies": { + "Newtonsoft.Json": "12.0.3" + }, "compile": { "bin/placeholder/MatrixDotNetLib.dll": {} }, @@ -15,6 +27,37 @@ } }, "libraries": { + "Newtonsoft.Json/12.0.3": { + "sha512": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "type": "package", + "path": "newtonsoft.json/12.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", + "newtonsoft.json.12.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, "MatrixDotNetLib/1.0.0": { "type": "project", "path": "../MatrixDotNetLib/MatrixDotNetLib.csproj", diff --git a/MatrixDotNetLib/MatrixDotNetCmd/obj/project.nuget.cache b/MatrixDotNetLib/MatrixDotNetCmd/obj/project.nuget.cache index dfe7d08..198184d 100644 --- a/MatrixDotNetLib/MatrixDotNetCmd/obj/project.nuget.cache +++ b/MatrixDotNetLib/MatrixDotNetCmd/obj/project.nuget.cache @@ -1,8 +1,10 @@ { "version": 2, - "dgSpecHash": "/And0b5Fmn9KmvRqoYIwpU+aYPZ3tOpcWNW71la94v+grVFCDobR3JbJQwG/7g1BRYhNza7okd7X7+ntHOryfw==", + "dgSpecHash": "8K9QsUKHtNC7PQ873ayC0GHP0lzCog8MTKCNWMZpyzUOnHRnzzR9zoCKZj29McVjauf8VButj3vnkK+05EZTuA==", "success": true, "projectFilePath": "D:\\Source\\MatrixDotNetLib\\MatrixDotNetLib\\MatrixDotNetCmd\\MatrixDotNetCmd.csproj", - "expectedPackageFiles": [], + "expectedPackageFiles": [ + "C:\\Users\\Claire\\.nuget\\packages\\newtonsoft.json\\12.0.3\\newtonsoft.json.12.0.3.nupkg.sha512" + ], "logs": [] } \ No newline at end of file diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixApis.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixApis.cs new file mode 100644 index 0000000..340db4b --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixApis.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatrixDotNetLib +{ + public class MatrixApis + { + public static Dictionary Server = new Dictionary() + { + { "discovery", "/.well-known/matrix/client" }, + { "versions", "/_matrix/client/versions" }, + { "capabilities", "/_matrix/client/r0/capabilities" }, + { "whois", "/_matrix/client/r0/admin/whois/{uid}" }, + { "search", "/_matrix/client/r0/search" }, + { "usersearch", "/_matrix/client/r0/user_directory/search" }, + { "roomlist", "/_matrix/client/r0/publicRooms" }, + { "managerooms", "/_matrix/client/r0/directory/list/appservice/{networkId}/{roomId}" }, + { "upgraderoom", "/_matrix/client/r0/rooms/{roomId}/upgrade" }, + { "openid", "/_matrix/client/r0/user/{userId}/openid/request_token" }, + { "voip", "/_matrix/client/r0/voip/turnServer" } + }; + + public static Dictionary Key = new Dictionary() + { + { "latest", "/_matrix/client/r0/keys/changes" }, + { "claim", "/_matrix/client/r0/keys/claim" }, + { "download", "/_matrix/client/r0/keys/query" }, + { "upload", "/_matrix/client/r0/keys/upload" } + }; + + public static Dictionary Device = new Dictionary() + { + { "manage", "/_matrix/client/r0/devices" }, + { "multidelete", "/_matrix/client/r0/delete_devices" }, + { "send", "/_matrix/client/r0/sendToDevice/{eventType}/{txnId}" } + }; + + public static Dictionary Media = new Dictionary() + { + { "config", "/_matrix/media/r0/config" }, + { "save", "/_matrix/media/r0/download/{serverName}/{mediaId}" }, + { "saveas", "/_matrix/media/r0/download/{serverName}/{mediaId}/{fileName}" }, + { "preview", "/_matrix/media/r0/preview_url" }, + { "thumb", "/_matrix/media/r0/thumbnail/{serverName}/{mediaId}" }, + { "upload", "/_matrix/media/r0/upload" } + }; + + public static Dictionary Notifier = new Dictionary() + { + { "notifiers", "/_matrix/client/r0/notifications" }, + { "pushers", "/_matrix/client/r0/pushers" }, + { "set", "/_matrix/client/r0/pushers/set" }, + { "rules", "/_matrix/client/r0/pushrules/" } + }; + + public static Dictionary NotifierRule = new Dictionary() + { + { "manage", "/_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}" }, + { "actions", "/_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/actions" }, + { "toggle", "/_matrix/client/r0/pushrules/{scope}/{kind}/{ruleId}/enabled" } + }; + + public static Dictionary User = new Dictionary() + { + { "thirdparty", "/_matrix/client/r0/account/3pid" }, + { "deactivate", "/_matrix/client/r0/account/deactivate" }, + { "password", "/_matrix/client/r0/account/password" }, + { "register", "/_matrix/client/r0/register" }, + { "whoami", "/_matrix/client/r0/account/whoami" }, + { "profile", "/_matrix/client/r0/profile/{userId}" }, + { "avatar", "/_matrix/client/r0/profile/{userId}/avtatar_url" }, + { "displayname", "/_matrix/client/r0/profile/{userId}/displayname" }, + { "extrainfo", "/_matrix/client/r0/user/{userId}/account_data/{type}" }, + { "eventfilter", "/_matrix/client/r0/user/{userId}/filter" }, + { "rooms", "/_matrix/client/r0/joined_rooms" }, + { "login", "/_matrix/client/r0/login" }, + { "logout", "/_matrix/client/r0/logout" }, + { "status", "/_matrix/client/r0/presence/{userId}/status" } + }; + + public static Dictionary UserRoom = new Dictionary() + { + { "extrainfo", "/_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type}" }, + { "tags", "/_matrix/client/r0/user/{userId}/rooms/{roomId}/tags" } + }; + + public static Dictionary Room = new Dictionary() + { + { "create", "/_matrix/client/r0/createRoom" }, + { "aliases", "/_matrix/client/r0/rooms/{roomId}/aliases" }, + { "active", "/_matrix/client/r0/rooms/{roomId}/joined_members" }, + { "members", "/_matrix/client/r0/rooms/{roomId}/members" }, + { "messages", "/_matrix/client/r0/rooms/{roomId}/messages" }, + { "join", "/_matrix/client/r0/join/{roomIdOrAlias}" }, + { "ban", "/_matrix/client/r0/rooms/{roomId}/ban" }, + { "forget", "/_matrix/client/r0/rooms/{roomId}/forget" }, + { "invite", "/_matrix/client/r0/rooms/{roomId}/invite" }, + { "idjoin", "/_matrix/client/r0/rooms/{roomId}/join" }, + { "kick", "/_matrix/client/r0/rooms/{roomId}/kick" }, + { "leave", "/_matrix/client/r0/rooms/{roomId}/leave" }, + { "unban", "/_matrix/client/r0/rooms/{roomId}/unban" }, + { "marker", "/_matrix/client/r0/rooms/{roomId}/read_markers" } + }; + + public static Dictionary RoomEvent = new Dictionary() + { + { "context", "/_matrix/client/r0/rooms/{roomId}/context/{eventId}" }, + { "event", "/_matrix/client/r0/rooms/{roomId}/event/{eventId}" }, + { "receipt", "/_matrix/client/r0/rooms/{roomId}/receipt/{receiptType}/{eventId}" }, + { "redact", "/_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId}" }, + { "send", "/_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}" }, + { "typing", "/_matrix/client/r0/rooms/{roomId}/typing/{userId}" }, + { "flag", "/_matrix/client/r0/rooms/{roomId}/report/{eventId}" } + }; + + public static Dictionary RoomState = new Dictionary() + { + { "list", "/_matrix/client/r0/rooms/{roomId}/state" }, + { "state", "/_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}" } + }; + } + + class HotDamn + { + public void testfunc() + { + // the avatar + string Avatar = MatrixApis.User["avatar"]; + } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixClient.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixClient.cs deleted file mode 100644 index f9b8357..0000000 --- a/MatrixDotNetLib/MatrixDotNetLib/MatrixClient.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace MatrixDotNetLib -{ - public class MatrixClient - { - - } -} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixDotNetLib.csproj b/MatrixDotNetLib/MatrixDotNetLib/MatrixDotNetLib.csproj index cb63190..a20524d 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/MatrixDotNetLib.csproj +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixDotNetLib.csproj @@ -4,4 +4,8 @@ netcoreapp3.1 + + + + diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixError.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixError.cs new file mode 100644 index 0000000..fe43666 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixError.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatrixDotNetLib +{ + public class MatrixError + { + /// + /// Gets or sets the error code (required) + /// + [JsonProperty("errcode")] + public string ErrorCode { get; set; } + + /// + /// Gets or sets the friendly error message (optional) + /// + [JsonProperty("error")] + public string ErrorMessage { get; set; } + + /// + /// Gets or sets the delay in milliseconds (optional) + /// + [JsonProperty("retry_after_ms")] + public Int32 RetryDelay { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginFlows.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginFlows.cs new file mode 100644 index 0000000..7d51a0c --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginFlows.cs @@ -0,0 +1,14 @@ +using Newtonsoft.Json; +using System; + +namespace MatrixDotNetLib +{ + public class MatrixLoginFlows + { + /// + /// Gets or sets the array of available login types + /// + [JsonProperty("flows")] + public MatrixLoginType[] LoginFlows { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginIdentifier.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginIdentifier.cs new file mode 100644 index 0000000..88a0ed5 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginIdentifier.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatrixDotNetLib +{ + public class MatrixLoginIdentifier + { + /// + /// Gets or sets the login identifier type (required) + /// + [JsonProperty("type")] + public string IdType { get; set; } + + /// + /// Gets or sets the username (required if IdType is m.id.user) + /// + [JsonProperty("user")] + public string User { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginRequest.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginRequest.cs new file mode 100644 index 0000000..0af05b6 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginRequest.cs @@ -0,0 +1,49 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; + +namespace MatrixDotNetLib +{ + public class MatrixLoginRequest + { + /// + /// Gets or sets the client device ID (optional, auto-generated if null) + /// + [JsonProperty("device_id")] + public string DeviceId { get; set; } + + /// + /// Gets or sets user identifier as string (optional) + /// + [JsonProperty("identifier")] + public MatrixLoginIdentifier Identifier { get; set; } + + /// + /// Gets or sets the device display name (optional, ignored if device is known) + /// + [JsonProperty("initial_device_display_name")] + public string DeviceName { get; set; } + + /// + /// Gets or sets the password (required if type=m.login.password) + /// + [JsonProperty("password")] + public string Password { get; set; } + + /// + /// Gets or sets the login token (required if type=m.login.token) + /// + [JsonProperty("token")] + public string Token { get; set; } + + /// + /// Sets the static dictionary of login types (required) + /// + [JsonProperty("type")] + public string LoginType { get; set; } + + + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginResponse.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginResponse.cs new file mode 100644 index 0000000..26aadf4 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginResponse.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatrixDotNetLib +{ + public class MatrixLoginResponse + { + /// + /// Gets or sets the access token (optional) + /// + [JsonProperty("access_token")] + public string Token { get; set; } + + /// + /// Gets or sets the device ID (optional) + /// + [JsonProperty("device_id")] + public string DeviceId { get; set; } + + /// + /// Gets or sets the user ID (optional) + /// + [JsonProperty("user_id")] + public string UserId { get; set; } + + /// + /// Gets or sets client configuration (optional) + /// + [JsonProperty("well_known")] + public MatrixUserServers KnownServers { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginType.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginType.cs new file mode 100644 index 0000000..3c61884 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixLoginType.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace MatrixDotNetLib +{ + public class MatrixLoginType + { + /// + /// Gets or sets the login type + /// + [JsonProperty("type")] + public string LoginType { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixSessionManager.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixSessionManager.cs new file mode 100644 index 0000000..8ca2add --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixSessionManager.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Reflection.Metadata.Ecma335; +using System.Text; +using System.Threading.Tasks; + +namespace MatrixDotNetLib +{ + public class MatrixSessionManager + { + public MatrixLoginResponse Login(string server, string user, string pass, string device = "") + { + MatrixLoginIdentifier userId = new MatrixLoginIdentifier() + { + IdType = "m.id.user", + User = user + }; + + MatrixLoginRequest theRequest = new MatrixLoginRequest() + { + Password = pass, + Identifier = userId, + LoginType = "m.login.password" + }; + + if (device.Length > 0) + { + theRequest.DeviceId = device; + } + + // create a web request + string loginUrl = "https://" + server + MatrixApis.User["login"]; + + // serialize object into JSON + string requestJson = JsonConvert.SerializeObject(theRequest); + + HttpContent requestContent = new StringContent(requestJson, Encoding.UTF8, "application/json"); + + HttpClient client = new HttpClient(); + client.BaseAddress = new Uri(loginUrl); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + HttpResponseMessage responseMessage = client.PostAsync(loginUrl, requestContent).Result; + string responseString = responseMessage.Content.ReadAsStringAsync().Result; + + MatrixLoginResponse response = JsonConvert.DeserializeObject(responseString); + + return response; + } + } +} \ No newline at end of file diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixUser.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixUser.cs new file mode 100644 index 0000000..b4de1c4 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixUser.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; + +namespace MatrixDotNetLib +{ + public class MatrixUser + { + /// + /// Gets or sets user id as a string + /// + [JsonProperty("user_id")] + public string userid { get; set; } + + /// + /// Gets or sets access token as a string + /// + [JsonProperty("access_token")] + public string token { get; set; } + + /// + /// Gets or sets home server as string + /// + [JsonProperty("home_server")] + public string server { get; set; } + + /// + /// Gets or sets device id as string (optional) + /// + [JsonProperty("device_id")] + public string deviceid { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixUserServer.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixUserServer.cs new file mode 100644 index 0000000..68f45a7 --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixUserServer.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace MatrixDotNetLib +{ + public class MatrixUserServer + { + /// + /// Gets or sets the server URL + /// + [JsonProperty("base_url")] + public string BaseUrl { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/MatrixUserServers.cs b/MatrixDotNetLib/MatrixDotNetLib/MatrixUserServers.cs new file mode 100644 index 0000000..93e69fd --- /dev/null +++ b/MatrixDotNetLib/MatrixDotNetLib/MatrixUserServers.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatrixDotNetLib +{ + public class MatrixUserServers + { + /// + /// Gets or sets the home server + /// + [JsonProperty("m.homeserver")] + public MatrixUserServer HomeServer { get; set; } + + /// + /// Gets or sets the identity server + /// + [JsonProperty("m.identity_server")] + public MatrixUserServer IdentityServer { get; set; } + } +} diff --git a/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.deps.json b/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.deps.json index 5716fa0..07a0d80 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.deps.json +++ b/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.deps.json @@ -7,9 +7,20 @@ "targets": { ".NETCoreApp,Version=v3.1": { "MatrixDotNetLib/1.0.0": { + "dependencies": { + "Newtonsoft.Json": "12.0.3" + }, "runtime": { "MatrixDotNetLib.dll": {} } + }, + "Newtonsoft.Json/12.0.3": { + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": { + "assemblyVersion": "12.0.0.0", + "fileVersion": "12.0.3.23909" + } + } } } }, @@ -18,6 +29,13 @@ "type": "project", "serviceable": false, "sha512": "" + }, + "Newtonsoft.Json/12.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "path": "newtonsoft.json/12.0.3", + "hashPath": "newtonsoft.json.12.0.3.nupkg.sha512" } } } \ No newline at end of file diff --git a/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.dll b/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.dll index 7fc63ab..6de0af9 100644 Binary files a/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.dll and b/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.dll differ diff --git a/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.pdb b/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.pdb index 9266272..1eceee0 100644 Binary files a/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.pdb and b/MatrixDotNetLib/MatrixDotNetLib/bin/Debug/netcoreapp3.1/MatrixDotNetLib.pdb differ diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.assets.cache b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.assets.cache index 397f129..baf317b 100644 Binary files a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.assets.cache and b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.assets.cache differ diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.CoreCompileInputs.cache b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.CoreCompileInputs.cache index 4bda63d..143c214 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.CoreCompileInputs.cache +++ b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -bebfa3bded4fe686bd663f099492d7164d88fe28 +f16bca70409c8e2ae88277b1bedf2f151bb03767 diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.FileListAbsolute.txt b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.FileListAbsolute.txt index 56057c6..b8f2a01 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.FileListAbsolute.txt +++ b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csproj.FileListAbsolute.txt @@ -2,8 +2,8 @@ D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\bin\Debug\netcoreapp3. D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\bin\Debug\netcoreapp3.1\MatrixDotNetLib.dll D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\bin\Debug\netcoreapp3.1\MatrixDotNetLib.pdb D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.csprojAssemblyReference.cache -D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.csproj.CoreCompileInputs.cache D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.AssemblyInfoInputs.cache D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.AssemblyInfo.cs D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.dll D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.pdb +D:\Source\MatrixDotNetLib\MatrixDotNetLib\MatrixDotNetLib\obj\Debug\netcoreapp3.1\MatrixDotNetLib.csproj.CoreCompileInputs.cache diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csprojAssemblyReference.cache b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csprojAssemblyReference.cache index 74fe67b..f812bae 100644 Binary files a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csprojAssemblyReference.cache and b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.csprojAssemblyReference.cache differ diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.dll b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.dll index 7fc63ab..6de0af9 100644 Binary files a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.dll and b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.dll differ diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.pdb b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.pdb index 9266272..1eceee0 100644 Binary files a/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.pdb and b/MatrixDotNetLib/MatrixDotNetLib/obj/Debug/netcoreapp3.1/MatrixDotNetLib.pdb differ diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/MatrixDotNetLib.csproj.nuget.dgspec.json b/MatrixDotNetLib/MatrixDotNetLib/obj/MatrixDotNetLib.csproj.nuget.dgspec.json index f9c7c1c..625350c 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/obj/MatrixDotNetLib.csproj.nuget.dgspec.json +++ b/MatrixDotNetLib/MatrixDotNetLib/obj/MatrixDotNetLib.csproj.nuget.dgspec.json @@ -37,6 +37,12 @@ }, "frameworks": { "netcoreapp3.1": { + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, "imports": [ "net461", "net462", diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/project.assets.json b/MatrixDotNetLib/MatrixDotNetLib/obj/project.assets.json index dc7aa86..5657bf4 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/obj/project.assets.json +++ b/MatrixDotNetLib/MatrixDotNetLib/obj/project.assets.json @@ -1,11 +1,55 @@ { "version": 3, "targets": { - ".NETCoreApp,Version=v3.1": {} + ".NETCoreApp,Version=v3.1": { + "Newtonsoft.Json/12.0.3": { + "type": "package", + "compile": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + } + } + } + }, + "libraries": { + "Newtonsoft.Json/12.0.3": { + "sha512": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "type": "package", + "path": "newtonsoft.json/12.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", + "newtonsoft.json.12.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + } }, - "libraries": {}, "projectFileDependencyGroups": { - ".NETCoreApp,Version=v3.1": [] + ".NETCoreApp,Version=v3.1": [ + "Newtonsoft.Json >= 12.0.3" + ] }, "packageFolders": { "C:\\Users\\Claire\\.nuget\\packages\\": {} @@ -43,6 +87,12 @@ }, "frameworks": { "netcoreapp3.1": { + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, "imports": [ "net461", "net462", diff --git a/MatrixDotNetLib/MatrixDotNetLib/obj/project.nuget.cache b/MatrixDotNetLib/MatrixDotNetLib/obj/project.nuget.cache index 640d83f..960eb21 100644 --- a/MatrixDotNetLib/MatrixDotNetLib/obj/project.nuget.cache +++ b/MatrixDotNetLib/MatrixDotNetLib/obj/project.nuget.cache @@ -1,8 +1,10 @@ { "version": 2, - "dgSpecHash": "6v622xy25DE5lRrEgpsiWk2YtQjIi38nbMXINLdc/3QnYXSe1ti2zp/2q7CTNPT3u+UJEjyWV0GE4lClJkOjXg==", + "dgSpecHash": "HSqSJqUuJZSv4YceApWKKSok/vyC24dgbjbsKNopZt2t8ILlKoApuI5ZMQ2Wm+AKO8PAKuY9eeR4/hEyKBtJIg==", "success": true, "projectFilePath": "D:\\Source\\MatrixDotNetLib\\MatrixDotNetLib\\MatrixDotNetLib\\MatrixDotNetLib.csproj", - "expectedPackageFiles": [], + "expectedPackageFiles": [ + "C:\\Users\\Claire\\.nuget\\packages\\newtonsoft.json\\12.0.3\\newtonsoft.json.12.0.3.nupkg.sha512" + ], "logs": [] } \ No newline at end of file