Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Fully fixing the app for .NET Native.
Browse files Browse the repository at this point in the history
  • Loading branch information
woachk committed Apr 12, 2017
1 parent 2fcc66f commit 14a59c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions MastodonAPI/ApplicationClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ You should have received a copy of the GNU General Public License
*/
namespace MastodonAPI
{
class ApplicationClass
public class ApplicationClass
{
public string name;
public string website;
public string name { get; set; }
public string website { get; set; }
}
}
13 changes: 9 additions & 4 deletions MastodonAPI/NotificationClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ namespace MastodonAPI
{
public class NotificationClass_new
{
static public dynamic getNotifications(AuthenticateClass token)
public string id { get; set; }
public string type { get; set; }
public string created_at { get; set; }
public AccountClass account { get; set; }
public StatusClass_new status { get; set; }
static public NotificationClass_new[] getNotifications(AuthenticateClass token)
{
List<NotificationClass> notifications = new List<NotificationClass>();
HttpClient client = new HttpClient();
Expand All @@ -34,12 +39,12 @@ static public dynamic getNotifications(AuthenticateClass token)
message.Wait();
HttpResponseMessage msg = message.Result;
String json = (msg.Content).ReadAsStringAsync().Result;
dynamic obj = JsonConvert.DeserializeObject<dynamic>(json);
NotificationClass_new[] obj = JsonConvert.DeserializeObject<NotificationClass_new[]>(json);
return obj;
}
static public dynamic parseNotification(string json)
static public NotificationClass_new parseNotification(string json)
{
dynamic obj = JsonConvert.DeserializeObject<dynamic>(json);
dynamic obj = JsonConvert.DeserializeObject<NotificationClass_new>(json);
return obj;
}
}
Expand Down
2 changes: 1 addition & 1 deletion MastodonAPI/StatusClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class StatusClass_new
public string sensitive { get; set; }
public string spoiler_text { get; set; }
public string visiblity { get; set; }
public string application { get; set; }
public ApplicationClass application { get; set; }
static public StatusClass_new parseToot(string json)
{
return JsonConvert.DeserializeObject<StatusClass_new>(json);
Expand Down
4 changes: 2 additions & 2 deletions MastodonUWA/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
}
else
{
dynamic notifications = NotificationClass_new.getNotifications(token);
for (int i = notifications.Count - 1; i >= 0; i--)
NotificationClass_new[] notifications = NotificationClass_new.getNotifications(token);
for (int i = notifications.Length - 1; i >= 0; i--)
{
if (notifications[i].id != null)
{
Expand Down

0 comments on commit 14a59c1

Please sign in to comment.