Browse Source

Started creating types for the event (sync) feed

master
Claire 4 years ago
parent
commit
d128f9d811
  1. 3
      MatrixDotNetLib/MatrixDotNetCmd/Program.cs
  2. 26
      MatrixDotNetLib/MatrixDotNetLib/MatrixApi.cs
  3. 164
      MatrixDotNetLib/MatrixDotNetLib/MatrixApiEntities.cs
  4. 224
      MatrixDotNetLib/MatrixDotNetLib/MatrixSessionManager.cs
  5. 191
      Other Resources/matrix.org.json
  6. 6
      README.md
  7. 25
      Scripts/.vscode/launch.json
  8. 42
      Scripts/.vscode/tasks.json
  9. 12
      Scripts/ParseTest/ParseTest.csproj
  10. 141
      Scripts/ParseTest/Program.cs
  11. 79
      Scripts/dynamic JSON parsing of sync responses.linq

3
MatrixDotNetLib/MatrixDotNetCmd/Program.cs

@ -167,6 +167,9 @@ namespace MatrixDotNetCmd
string theRoomAlias = roomz[roomListInt].ToString(); string theRoomAlias = roomz[roomListInt].ToString();
// now we can join the room or something // now we can join the room or something
MatrixRoom theRoom = session.JoinRoom(theRoomId);
// with this room we can sync for events
} }
} }

26
MatrixDotNetLib/MatrixDotNetLib/MatrixApis.cs → MatrixDotNetLib/MatrixDotNetLib/MatrixApi.cs

@ -4,7 +4,7 @@ using System.Text;
namespace MatrixDotNetLib namespace MatrixDotNetLib
{ {
public class MatrixApis public class MatrixApi
{ {
public static class Server public static class Server
{ {
@ -641,30 +641,6 @@ namespace MatrixDotNetLib
} }
} }
public class MatrixApiEntities
{
public string DeviceId { get; set; }
public string EventId { get; set; }
public string EventType { get; set; }
public string Filename { get; set; }
public string FilterId { get; set; }
public string Kind { get; set; }
public string MediaId { get; set; }
public string NetworkId { get; set; }
public string ReceiptType { get; set; }
public string RoomAlias { get; set; }
public string RoomId { get; set; }
public string RoomIdOrAlias { get; set; }
public string RuleId { get; set; }
public string Scope { get; set; }
public string ServerName { get; set; }
public string StateKey { get; set; }
public string Tags { get; set; }
public string TxnId { get; set; }
public string Type { get; set; }
public string UserId { get; set; }
}
//public static Dictionary<string, string> Server = new Dictionary<string, string>() //public static Dictionary<string, string> Server = new Dictionary<string, string>()
//{ //{
// { "discovery", "/.well-known/matrix/client" }, // { "discovery", "/.well-known/matrix/client" },

164
MatrixDotNetLib/MatrixDotNetLib/MatrixApiEntities.cs

@ -0,0 +1,164 @@
namespace MatrixDotNetLib
{
public class MatrixApiEntities
{
public string DeviceId { get; set; }
public string EventId { get; set; }
public string EventType { get; set; }
public string Filename { get; set; }
public string FilterId { get; set; }
public string Kind { get; set; }
public string MediaId { get; set; }
public string NetworkId { get; set; }
public string ReceiptType { get; set; }
public string RoomAlias { get; set; }
public string RoomId { get; set; }
public string RoomIdOrAlias { get; set; }
public string RuleId { get; set; }
public string Scope { get; set; }
public string ServerName { get; set; }
public string StateKey { get; set; }
public string Tags { get; set; }
public string TxnId { get; set; }
public string Type { get; set; }
public string UserId { get; set; }
}
//public static Dictionary<string, string> Server = new Dictionary<string, string>()
//{
// { "discovery", "/.well-known/matrix/client" },
// { "versions", "/_matrix/client/versions" },
// { "capabilities", "/_matrix/client/r0/capabilities" },
// { "whois", "/_matrix/client/r0/admin/whois/{userId}" },
// { "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<string, string> Key = new Dictionary<string, string>()
//{
// { "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<string, string> Device = new Dictionary<string, string>()
//{
// { "manage", "/_matrix/client/r0/devices" },
// { "multidelete", "/_matrix/client/r0/delete_devices" },
// { "send", "/_matrix/client/r0/sendToDevice/{eventType}/{txnId}" }
//};
//public static Dictionary<string, string> Media = new Dictionary<string, string>()
//{
// { "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<string, string> Notifier = new Dictionary<string, string>()
//{
// { "notifiers", "/_matrix/client/r0/notifications" },
// { "pushers", "/_matrix/client/r0/pushers" },
// { "set", "/_matrix/client/r0/pushers/set" },
// { "rules", "/_matrix/client/r0/pushrules/" }
//};
//public static Dictionary<string, string> NotifierRule = new Dictionary<string, string>()
//{
// { "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<string, string> User = new Dictionary<string, string>()
//{
// { "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<string, string> UserRoom = new Dictionary<string, string>()
//{
// { "extrainfo", "/_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type}" },
// { "tags", "/_matrix/client/r0/user/{userId}/rooms/{roomId}/tags" }
//};
//public static Dictionary<string, string> Room = new Dictionary<string, string>()
//{
// { "create", "/_matrix/client/r0/createRoom" },
// { "aliases", "/_matrix/client/unstable/org.matrix.msc2432/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<string, string> RoomEvent = new Dictionary<string, string>()
//{
// { "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<string, string> RoomState = new Dictionary<string, string>()
//{
// { "list", "/_matrix/client/r0/rooms/{roomId}/state" },
// { "state", "/_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}" }
//};
//public Dictionary<string, string> Entities = new Dictionary<string, string>()
//{
// { "deviceId", "" },
// { "eventId", "" },
// { "eventType", "" },
// { "fileName", "" },
// { "filterId", "" },
// { "kind", "" },
// { "mediaId", "" },
// { "networkId", "" },
// { "receiptType", "" },
// { "roomAlias", "" },
// { "roomId", "" },
// { "roomIdOrAlias", "" },
// { "ruleId", "" },
// { "scope", "" },
// { "serverName", "" },
// { "stateKey", "" },
// { "tags", "" },
// { "txnId", "" },
// { "type", "" },
// { "userId", "" }
//};
}

224
MatrixDotNetLib/MatrixDotNetLib/MatrixSessionManager.cs

@ -1,4 +1,5 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -65,7 +66,7 @@ namespace MatrixDotNetLib
// serialize object into JSON // serialize object into JSON
string requestJson = JsonConvert.SerializeObject(theRequest); string requestJson = JsonConvert.SerializeObject(theRequest);
string responseJson = ApiResult(MatrixApis.User.Login, httpAction.POST, requestJson); string responseJson = ApiResult(MatrixApi.User.Login, httpAction.POST, requestJson);
MatrixLoginResponse response = JsonConvert.DeserializeObject<MatrixLoginResponse>(responseJson); MatrixLoginResponse response = JsonConvert.DeserializeObject<MatrixLoginResponse>(responseJson);
@ -84,7 +85,7 @@ namespace MatrixDotNetLib
/// <returns></returns> /// <returns></returns>
public MatrixUserRooms GetRooms() public MatrixUserRooms GetRooms()
{ {
string responseJson = ApiResult(MatrixApis.User.Rooms, httpAction.GET); string responseJson = ApiResult(MatrixApi.User.Rooms, httpAction.GET);
return (MatrixUserRooms)JsonConvert.DeserializeObject<MatrixUserRooms>(responseJson); return (MatrixUserRooms)JsonConvert.DeserializeObject<MatrixUserRooms>(responseJson);
} }
@ -92,16 +93,31 @@ namespace MatrixDotNetLib
/// <summary> /// <summary>
/// Gets the aliases for the given (string)roomId /// Gets the aliases for the given (string)roomId
/// </summary> /// </summary>
/// <param name="roomId"></param> /// <param name="roomId">Full string ID (not alias) of a room</param>
/// <returns></returns> /// <returns></returns>
public MatrixRoomAliases GetRoomAliases(string roomId) public MatrixRoomAliases GetRoomAliases(string roomId)
{ {
MatrixApiEntities entities = new MatrixApiEntities() { RoomId = roomId }; MatrixApiEntities entities = new MatrixApiEntities() { RoomId = roomId };
string responseJson = ApiResult(MatrixApis.Room.Aliases, httpAction.GET, entities: entities); string responseJson = ApiResult(MatrixApi.Room.Aliases, httpAction.GET, entities: entities);
return (MatrixRoomAliases)JsonConvert.DeserializeObject<MatrixRoomAliases>(responseJson); return (MatrixRoomAliases)JsonConvert.DeserializeObject<MatrixRoomAliases>(responseJson);
} }
/// <summary>
/// Joins the user to the given room by (string)roomId
/// </summary>
/// <param name="roomId">Full string ID (not alias) of a room</param>
/// <returns></returns>
public MatrixRoom JoinRoom(string roomId)
{
// create entity object
MatrixApiEntities apiEntities = new MatrixApiEntities() { RoomId = roomId };
string responseJson = ApiResult(MatrixApi.Room.Join, httpAction.POST, entities: apiEntities);
return (MatrixRoom)JsonConvert.DeserializeObject<MatrixRoom>(responseJson);
}
public MatrixRoomDirectory GetPublicRooms(int limit = 0, string page = null, string server = null) public MatrixRoomDirectory GetPublicRooms(int limit = 0, string page = null, string server = null)
{ {
string[] querystring = { }; string[] querystring = { };
@ -127,11 +143,11 @@ namespace MatrixDotNetLib
{ {
string qs = string.Join("&", querystring); string qs = string.Join("&", querystring);
responseJson = ApiResult(MatrixApis.Server.RoomList, httpAction.GET, query: qs); responseJson = ApiResult(MatrixApi.Server.RoomList, httpAction.GET, query: qs);
} }
else else
{ {
responseJson = ApiResult(MatrixApis.Server.RoomList, httpAction.GET); responseJson = ApiResult(MatrixApi.Server.RoomList, httpAction.GET);
} }
return (MatrixRoomDirectory)JsonConvert.DeserializeObject<MatrixRoomDirectory>(responseJson); return (MatrixRoomDirectory)JsonConvert.DeserializeObject<MatrixRoomDirectory>(responseJson);
@ -267,6 +283,202 @@ namespace MatrixDotNetLib
} }
} }
} }
// classes to be moved //
public class MatrixSyncBody
{
public MatrixSyncRooms Rooms { get; set; }
}
public class MatrixSyncRooms
{
// once the JSON from "join" is parsed, this is set to its contents as an object
public Dictionary<string,MatrixSyncRoom> Joined { get; private set;}
public Dictionary<string, MatrixSyncRoom> Invited { get; private set; }
public Dictionary<string, MatrixSyncRoom> Left { get; private set; }
public JObject Join
{
get { return null; }
set
{
// takes JSON children and parses them into objects
// we have to do this bc the entity names under "join" are dynamic
// each entity holds a well-defined object though
// create dict for Joined
Joined = new Dictionary<string, MatrixSyncRoom>();
// these AREN'T an array
ParseRooms(value, "Joined");
}
}
public JObject Invite
{
get { return null; }
set
{
// create dict for Joined
Invited = new Dictionary<string, MatrixSyncRoom>();
// these AREN'T an array
ParseRooms(value, "Invited");
}
}
public JObject Leave
{
get { return null; }
set
{
// create dict for Joined
Left = new Dictionary<string, MatrixSyncRoom>();
// these AREN'T an array
ParseRooms(value, "Left");
}
}
public void ParseRooms(JObject roomsJson, string valType)
{
// get the children of this object
JEnumerable<JToken> kids = roomsJson.Children();
Dictionary<string,MatrixSyncRoom> roomList = new Dictionary<string,MatrixSyncRoom>();
foreach (JProperty kid in kids)
{
MatrixSyncRoom msr = JsonConvert.DeserializeObject<MatrixSyncRoom>(kid.Value.ToString());
roomList.Add(kid.Name, msr);
}
// get the target
this.GetType().GetProperty(valType).SetValue(this,roomList);
}
}
public class MatrixSyncRoom
{
public MatrixTimeline Timeline { get; set; }
}
public class MatrixTimeline
{
public MatrixEvent[] Events { get; set; }
[JsonProperty("prev_batch")]
public string PreviousBatch { get; set; }
public bool IsLimited { get; set; }
}
public class MatrixEvent
{
[JsonProperty("type")]
public string EventType { get; set; }
public string Sender { get; set; }
public MatrixEventContent Content { get; set; }
[JsonProperty("state_key")]
public string StateKey { get; set; }
[JsonProperty("origin_server_ts")]
public Int64 OriginTs { get; set; }
public MatrixEventUnsigned Unsigned { get; set; }
}
public class MatrixEventUnsigned
{
public int Age { get; set; }
[JsonProperty("replaces_state")]
public string ReplaceState { get; set; }
[JsonProperty("prev_content")]
public MatrixEventPrevContent PrevContent { get; set; }
}
public class MatrixEventPrevContent
{
[JsonProperty("is_direct")]
public bool IsDirect { get; set; }
public string Membership { get; set; }
public string DisplayName { get; set; }
}
public class MatrixEventContent
{
public string Body { get; set; }
public string Creator { get; set; }
public string DisplayName { get; set; }
[JsonProperty("event_id")]
public string EventId { get; set; }
/// <summary>
/// Gets or sets the event content info property - check FileInfo.MimeType for file type
/// </summary>
[JsonProperty("info")]
public MatrixImageInfo FileInfo { get; set; }
[JsonProperty("currently_active")]
public bool IsActive { get; set; }
[JsonProperty("join_rule")]
public string JoinRule { get; set; }
[JsonProperty("last_active_ago")]
public int LastActive { get; set; }
public string Membership { get; set; }
public string Name { get; set; }
public string Presence { get; set; }
[JsonProperty("room_version")]
public string RoomVersion { get; set; }
public List<string> Users { get; set; }
}
public class MatrixFileInfo
{
public Int64 size { get; set; }
public string MimeType { get; set; }
}
public class MatrixImageThumbInfo : MatrixFileInfo
{
[JsonProperty("w")]
public int Width { get; set; }
[JsonProperty("h")]
public int Height { get; set; }
}
public class MatrixImageInfo : MatrixImageThumbInfo
{
[JsonProperty("thumbnail_info")]
public MatrixImageThumbInfo ThumbnailInfo { get; set; }
public string ThumbnailUrl { get; set; }
}
} }

191
Other Resources/matrix.org.json

@ -0,0 +1,191 @@
[
{
"enabled": true,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1591921634962,
"name": "matrix.org",
"sections": [
{
"code": ".description {\n margin-bottom: 15px;\n}\n\n.description > DIV {\n margin: 1em 0;\n margin-right: 10px;\n}\n\n.description > DIV > SPAN.propDesc {\n display: block;\n margin-top: .25em;\n margin-left: 1em;\n}\n\n.swagger-section .swagger-ui-wrap .content PRE {\n margin-top: 0px;\n}\n\nLI.resource.active > DIV > UL.options,\nINPUT.submit {\n display: none !important;\n}\n\nDIV.description[style] {\n display: block !important;\n}\n\n.signature-container {\n overflow: hidden;\n}\n\n.signature-container DIV.description {\n background: #aacc3333;\n padding: 1em;\n}\n\n.signature-container DIV.description {\n float: left;\n width: 48%;\n}\n\n.signature-container DIV.snippet {\n float: right;\n width: 48%;\n}\n\nTD[width=\"50%\"] .signature-container > DIV {\n width: 100%;\n}\n\n.fullwidth.parameters > THEAD > TR > TH:nth-child(5) {\n display: none;\n}\n\n.operation-params > TR > TD:nth-child(5) {\n float: left;\n clear: both;\n margin-top: 60px;\n margin-left: -740px;\n margin-bottom: 2em;\n width: 1025px;\n}\n\n.operation-params .body-textarea {\n display: none;\n}\n\n.response-content-type {\n clear: both;\n}\n\n.model-signature PRE {\n height: unset !important;\n}\n\n@media only screen and (max-width: 980px)\n{\n .operation-params > TR > TD:nth-child(5) {\n margin-left: -670px;\n width: 660px;\n }\n .signature-container DIV.description,\n .signature-container DIV.snippet {\n width: 47%;\n }\n .signature-container DIV.description {\n float: left;\n }\n\n .signature-container DIV.snippet {\n float: right;\n }\n}",
"urlPrefixes": [
"https://matrix.org/docs/api"
]
}
],
"updateDate": 1591935819656,
"_id": "78c1d175-a540-4e3e-9939-829237f53a9b",
"_rev": 1591935819656,
"id": 4
},
{
"enabled": false,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1591933721024,
"name": "matrix.org (show most, hide nav)",
"sections": [
{
"code": "HEADER#main-header, DIV#message-bar {\n display: none;\n}\n\nDIV#page-container[style] {\n padding-top: 0px !important;\n}\n\n#document {\n margin-top: 0px;\n}\n\nDIV.content[style] {\n display: block !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api"
]
}
],
"updateDate": 1592011124949,
"_id": "48c11d9a-061f-4eca-8674-900156a6b187",
"_rev": 1592433818401,
"id": 5
},
{
"enabled": false,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1591936252379,
"name": "matrix.org (show all)",
"sections": [
{
"code": "UL.endpoints[style] {\n display: block !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api"
]
}
],
"updateDate": 1592011114678,
"_id": "8f05634d-071a-483f-99ae-48a58043a662",
"_rev": 1592433747949,
"id": 6
},
{
"enabled": true,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1592357694067,
"name": "matrix.org (show lists)",
"sections": [
{
"code": ".endpoints[style]\n{\n display: block !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api/"
]
}
],
"updateDate": 1592358199296,
"_id": "c4cc45dd-4c0f-42c3-b13b-190c81683518",
"_rev": 1592433745119,
"id": 7
},
{
"enabled": false,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1592357832873,
"name": "matrix.org (hide DELETE)",
"sections": [
{
"code": ".operations .delete.operation\n{\n display: none !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api/"
]
}
],
"updateDate": 1592357849841,
"_id": "0a76f07e-ca21-4d3e-8880-981941ec0756",
"_rev": 1592358183506,
"id": 8
},
{
"enabled": false,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1592357881387,
"name": "matrix.org (hide GET)",
"sections": [
{
"code": ".operations .get.operation\n{\n display: none !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api/"
]
}
],
"updateDate": 1592357901640,
"_id": "e5fea56f-376b-4f1a-b827-346d17e705e7",
"_rev": 1592358181378,
"id": 9
},
{
"enabled": false,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1592357963432,
"name": "matrix.org (hide POST)",
"sections": [
{
"code": ".operations .post.operation\n{\n display: none !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api/"
]
}
],
"updateDate": 1592357963432,
"_id": "620abd07-519e-4ac4-8367-e71a2f06d5fb",
"_rev": 1592358023907,
"id": 10
},
{
"enabled": false,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1592358008867,
"name": "matrix.org (hide PUT)",
"sections": [
{
"code": ".operations .put.operation\n{\n display: none !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api/"
]
}
],
"updateDate": 1592358008867,
"_id": "c453ff85-f36c-4e05-913c-27ba1f021ba2",
"_rev": 1592358179527,
"id": 11
},
{
"enabled": true,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1592433579958,
"name": "matrix.org (hide deprecated)",
"sections": [
{
"code": "#Room32participation_getEvents,\n#Room32participation_getOneEvent,\n#Room32participation_initialSync,\n#Room32participation_roomInitialSync\n{\n display: none !important;\n}",
"urlPrefixes": [
"https://matrix.org/docs/api/"
]
}
],
"updateDate": 1592434969286,
"_id": "f1f1a6db-7ed8-4cdc-9e97-148860429acd",
"_rev": 1592434969286,
"id": 12
}
]

6
README.md

@ -1,3 +1,7 @@
# MatrixDotNetLib # MatrixDotNetLib
A native .NET C# library for developing Matrix clients. A native .NET C# library for developing Matrix clients.
## Other Resources
There's a JSON file in there you can import into Stylus, the non-spyware version of Stylish. This makes it a little easier to use the [Swagger API documentation](https://matrix.org/docs/api/client-server/).

25
Scripts/.vscode/launch.json diff.vendored

@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/ParseTest/bin/Debug/netcoreapp3.1/ParseTest.dll",
"args": [],
"cwd": "${workspaceFolder}/ParseTest",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

42
Scripts/.vscode/tasks.json diff.vendored

@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/ParseTest/ParseTest.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/ParseTest/ParseTest.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/ParseTest/ParseTest.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}

12
Scripts/ParseTest/ParseTest.csproj

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
</Project>

141
Scripts/ParseTest/Program.cs

diff.file_suppressed_line_too_long

79
Scripts/dynamic JSON parsing of sync responses.linq

diff.file_suppressed_line_too_long
Loading…
Cancel
Save