[backend/core] Fix remote renotes being registered without a URI
This commit is contained in:
parent
36fe68ad4f
commit
58d78b568a
2 changed files with 4 additions and 2 deletions
|
@ -269,7 +269,8 @@ public class ActivityHandlerService(
|
||||||
throw GracefulException.UnprocessableEntity("Invalid or unsupported announce object");
|
throw GracefulException.UnprocessableEntity("Invalid or unsupported announce object");
|
||||||
|
|
||||||
var dbNote = await noteSvc.ResolveNoteAsync(note.Id, note);
|
var dbNote = await noteSvc.ResolveNoteAsync(note.Id, note);
|
||||||
await noteSvc.CreateNoteAsync(resolvedActor, announce.GetVisibility(activity.Actor), renote: dbNote);
|
await noteSvc.CreateNoteAsync(resolvedActor, announce.GetVisibility(activity.Actor), renote: dbNote,
|
||||||
|
uri: announce.Id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case ASEmojiReact reaction:
|
case ASEmojiReact reaction:
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class NoteService(
|
||||||
public async Task<Note> CreateNoteAsync(
|
public async Task<Note> CreateNoteAsync(
|
||||||
User user, Note.NoteVisibility visibility, string? text = null, string? cw = null, Note? reply = null,
|
User user, Note.NoteVisibility visibility, string? text = null, string? cw = null, Note? reply = null,
|
||||||
Note? renote = null, IReadOnlyCollection<DriveFile>? attachments = null, Poll? poll = null,
|
Note? renote = null, IReadOnlyCollection<DriveFile>? attachments = null, Poll? poll = null,
|
||||||
bool localOnly = false
|
bool localOnly = false, string? uri = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
logger.LogDebug("Creating note for local user {id}", user.Id);
|
logger.LogDebug("Creating note for local user {id}", user.Id);
|
||||||
|
@ -130,6 +130,7 @@ public class NoteService(
|
||||||
var note = new Note
|
var note = new Note
|
||||||
{
|
{
|
||||||
Id = IdHelpers.GenerateSlowflakeId(),
|
Id = IdHelpers.GenerateSlowflakeId(),
|
||||||
|
Uri = uri,
|
||||||
Text = text?.Trim(),
|
Text = text?.Trim(),
|
||||||
Cw = cw?.Trim(),
|
Cw = cw?.Trim(),
|
||||||
Reply = reply,
|
Reply = reply,
|
||||||
|
|
Loading…
Add table
Reference in a new issue