1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-07 19:13:19 +00:00

Push notification and sync fixes

This commit is contained in:
Kyle Spearrin
2016-06-30 00:36:44 -04:00
parent 8653a76e26
commit 7a48128e43
8 changed files with 26 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
using Bit.App.Enums;
using System;
using Newtonsoft.Json.Linq;
namespace Bit.App.Models.Api
{
@@ -9,7 +10,7 @@ namespace Bit.App.Models.Api
public string FolderId { get; set; }
public CipherType Type { get; set; }
public bool Favorite { get; set; }
public dynamic Data { get; set; }
public JObject Data { get; set; }
public DateTime RevisionDate { get; set; }
}
}

View File

@@ -32,11 +32,7 @@ namespace Bit.App.Models.Data
throw new ArgumentException(nameof(cipher.Type));
}
var data = cipher.Data as FolderDataModel;
if(data == null)
{
throw new ArgumentException(nameof(cipher.Data));
}
var data = cipher.Data.ToObject<SiteDataModel>();
Id = cipher.Id;
UserId = userId;

View File

@@ -2,6 +2,7 @@
using SQLite;
using Bit.App.Abstractions;
using Bit.App.Models.Api;
using Newtonsoft.Json.Linq;
namespace Bit.App.Models.Data
{
@@ -44,11 +45,7 @@ namespace Bit.App.Models.Data
throw new ArgumentException(nameof(cipher.Type));
}
var data = cipher.Data as SiteDataModel;
if(data == null)
{
throw new ArgumentException(nameof(cipher.Data));
}
var data = cipher.Data.ToObject<SiteDataModel>();
Id = cipher.Id;
UserId = userId;

View File

@@ -15,7 +15,7 @@ namespace Bit.App.Models.Page
Id = site.Id;
FolderId = folderId;
Name = site.Name?.Decrypt();
Username = site.Username?.Decrypt();
Username = site.Username?.Decrypt() ?? " ";
Password = site.Password?.Decrypt();
Uri = site.Uri?.Decrypt();
}

View File

@@ -1,4 +1,5 @@
using Bit.App.Enums;
using System;
using Bit.App.Enums;
namespace Bit.App.Models
{
@@ -7,13 +8,19 @@ namespace Bit.App.Models
public PushType Type { get; set; }
}
public class SyncPushNotification : PushNotification
public abstract class SyncPushNotification : PushNotification
{
public string UserId { get; set; }
}
public class SyncCipherPushNotification : SyncPushNotification
{
public string CipherId { get; set; }
public string Id { get; set; }
public DateTime RevisionDate { get; set; }
}
public class SyncCiphersPushNotification : SyncPushNotification
{
public DateTime Date { get; set; }
}
}