notesnook: add support for user profile
This commit is contained in:
@@ -153,6 +153,7 @@ namespace Notesnook.API.Services
|
||||
response.AttachmentsKey = userSettings.AttachmentsKey;
|
||||
response.Salt = userSettings.Salt;
|
||||
response.Subscription = subscription;
|
||||
response.Profile = userSettings.Profile;
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -163,6 +164,13 @@ namespace Notesnook.API.Services
|
||||
await Repositories.UsersSettings.UpdateAsync(userSettings.Id, userSettings);
|
||||
}
|
||||
|
||||
public async Task SetUserProfileAsync(string userId, IEncrypted profile)
|
||||
{
|
||||
var userSettings = await Repositories.UsersSettings.FindOneAsync((u) => u.UserId == userId);
|
||||
userSettings.Profile = (EncryptedData)profile;
|
||||
await Repositories.UsersSettings.UpdateAsync(userSettings.Id, userSettings);
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteUserAsync(string userId, string jti)
|
||||
{
|
||||
var cc = new CancellationTokenSource();
|
||||
@@ -220,6 +228,7 @@ namespace Notesnook.API.Services
|
||||
|
||||
userSettings.AttachmentsKey = null;
|
||||
userSettings.VaultKey = null;
|
||||
userSettings.Profile = null;
|
||||
userSettings.LastSynced = 0;
|
||||
|
||||
await Repositories.UsersSettings.UpsertAsync(userSettings, (s) => s.UserId == userId);
|
||||
|
||||
Reference in New Issue
Block a user