You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.2 KiB
76 lines
2.2 KiB
4 years ago
|
using Newtonsoft.Json;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace MatrixDotNetLib
|
||
|
{
|
||
|
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; }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
//// simplest implementation
|
||
|
//// might not work for UWP
|
||
|
//// sauce: https://stackoverflow.com/questions/5527316/how-to-set-the-content-of-an-httpwebrequest-in-c
|
||
|
//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;
|
||
|
|
||
|
//if(responseString.Contains("errcode"))
|
||
|
//{
|
||
|
// // deserialize into error object
|
||
|
// MatrixError error = JsonConvert.DeserializeObject<MatrixError>(responseString);
|
||
|
|
||
|
// // convert error object to a string
|
||
|
// string errMsg = error.ErrorCode + ": " + error.ErrorMessage;
|
||
|
|
||
|
// // throw exception (can be caught and handled gracefully)
|
||
|
// throw new Exception(errMsg);
|
||
|
//}
|
||
|
//else
|
||
|
//{
|
||
|
// MatrixLoginResponse response = JsonConvert.DeserializeObject<MatrixLoginResponse>(responseString);
|
||
|
|
||
|
// return response;
|
||
|
//}
|