[backend/masto-client] Set acct field in note mention correctly
This commit is contained in:
parent
158a4e05ad
commit
6c955262ee
3 changed files with 4 additions and 3 deletions
|
@ -80,7 +80,7 @@ public class NoteRenderer(
|
|||
.Select(u => new Mention {
|
||||
Id = u.Id,
|
||||
Username = u.Username,
|
||||
Acct = u.Acct,
|
||||
Acct = u.AcctWithPrefix,
|
||||
Url = u.UserProfile != null
|
||||
? u.UserProfile.Url ?? u.Uri ?? $"https://{config.Value.WebDomain}/@{u.Username}"
|
||||
: u.Uri ?? $"https://{config.Value.WebDomain}/@{u.Username}"
|
||||
|
|
|
@ -149,7 +149,8 @@ public class User : IEntity {
|
|||
[StringLength(512)]
|
||||
public string? Host { get; set; }
|
||||
|
||||
[NotMapped] [Projectable] public string Acct => "acct:" + Username + (Host != null ? "@" + Host : "");
|
||||
[NotMapped] [Projectable] public string Acct => Username + (Host != null ? "@" + Host : "");
|
||||
[NotMapped] [Projectable] public string AcctWithPrefix => "acct:" + Acct;
|
||||
|
||||
/// <summary>
|
||||
/// The inbox URL of the User. It will be null if the origin of the user is local.
|
||||
|
|
|
@ -130,7 +130,7 @@ public class UserService(
|
|||
logger.LogDebug("Updating user with uri {uri}", uri);
|
||||
|
||||
var actor = await fetchSvc.FetchActorAsync(user.Uri);
|
||||
actor.Normalize(uri, user.Acct);
|
||||
actor.Normalize(uri, user.AcctWithPrefix);
|
||||
|
||||
user.UserProfile ??= await db.UserProfiles.FirstOrDefaultAsync(p => p.User == user);
|
||||
user.UserProfile ??= new UserProfile { User = user };
|
||||
|
|
Loading…
Add table
Reference in a new issue