🐛 Fix missing file permission creation
This commit is contained in:
@@ -122,12 +122,16 @@ public class AccountCurrentController(
|
||||
{
|
||||
var file = await files.GetFileAsync(new GetFileRequest { Id = request.PictureId });
|
||||
profile.Picture = SnCloudFileReferenceObject.FromProtoValue(file);
|
||||
|
||||
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.PictureId });
|
||||
}
|
||||
|
||||
if (request.BackgroundId is not null)
|
||||
{
|
||||
var file = await files.GetFileAsync(new GetFileRequest { Id = request.BackgroundId });
|
||||
profile.Background = SnCloudFileReferenceObject.FromProtoValue(file);
|
||||
|
||||
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.BackgroundId });
|
||||
}
|
||||
|
||||
db.Update(profile);
|
||||
|
||||
@@ -229,12 +229,16 @@ public class AccountService(
|
||||
{
|
||||
var file = await files.GetFileAsync(new GetFileRequest { Id = pictureId });
|
||||
account.Profile.Picture = SnCloudFileReferenceObject.FromProtoValue(file);
|
||||
|
||||
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = pictureId });
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(backgroundId))
|
||||
{
|
||||
var file = await files.GetFileAsync(new GetFileRequest { Id = backgroundId });
|
||||
account.Profile.Background = SnCloudFileReferenceObject.FromProtoValue(file);
|
||||
|
||||
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = backgroundId });
|
||||
}
|
||||
|
||||
db.Accounts.Add(account);
|
||||
|
||||
@@ -53,12 +53,16 @@ public class BotAccountReceiverGrpc(
|
||||
{
|
||||
var file = await files.GetFileAsync(new GetFileRequest { Id = request.PictureId });
|
||||
account.Profile.Picture = SnCloudFileReferenceObject.FromProtoValue(file);
|
||||
|
||||
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.PictureId });
|
||||
}
|
||||
|
||||
if (request.BackgroundId is not null)
|
||||
{
|
||||
var file = await files.GetFileAsync(new GetFileRequest { Id = request.BackgroundId });
|
||||
account.Profile.Background = SnCloudFileReferenceObject.FromProtoValue(file);
|
||||
|
||||
await files.SetFilePublicAsync(new SetFilePublicRequest { FileId = request.BackgroundId });
|
||||
}
|
||||
|
||||
db.Accounts.Update(account);
|
||||
|
||||
Reference in New Issue
Block a user