Skip to content

Commit

Permalink
fix url missing with some AP softwares
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasConstant committed Apr 13, 2021
1 parent 32ef34a commit d0f817e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,4 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/src/BSLManager/Properties/launchSettings.json
5 changes: 4 additions & 1 deletion src/BirdsiteLive.Domain/ActivityPubService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public async Task<Actor> GetUser(string objectId)
httpClient.DefaultRequestHeaders.Add("Accept", "application/activity+json");
var result = await httpClient.GetAsync(objectId);
var content = await result.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<Actor>(content);

var actor = JsonConvert.DeserializeObject<Actor>(content);
if (string.IsNullOrWhiteSpace(actor.url)) actor.url = objectId;
return actor;
}

public async Task PostNewNoteActivity(Note note, string username, string noteId, string targetHost, string targetInbox)
Expand Down

0 comments on commit d0f817e

Please sign in to comment.