Skip to content

Commit

Permalink
Merge pull request #36 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
0.3.2 PR
  • Loading branch information
NicolasConstant authored Jan 9, 2021
2 parents f71fe04 + 9527faa commit 4197b9b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/BirdsiteLive.ActivityPub/Models/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BirdsiteLive.ActivityPub
public class Activity
{
[JsonProperty("@context")]
public string context { get; set; }
public object context { get; set; }
public string id { get; set; }
public string type { get; set; }
public string actor { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/BirdsiteLive.Domain/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task<bool> FollowRequestedAsync(string signature, string method, st
}
};
var result = await _activityPubService.PostDataAsync(acceptFollow, followerHost, activity.apObject);
return result == HttpStatusCode.Accepted;
return result == HttpStatusCode.Accepted || result == HttpStatusCode.OK;
}

private string OnlyKeepRoute(string inbox, string host)
Expand Down Expand Up @@ -159,7 +159,7 @@ public async Task<bool> UndoFollowRequestedAsync(string signature, string method
}
};
var result = await _activityPubService.PostDataAsync(acceptFollow, followerHost, activity.apObject.apObject);
return result == HttpStatusCode.Accepted;
return result == HttpStatusCode.Accepted || result == HttpStatusCode.OK;
}

private async Task<SignatureValidationResult> ValidateSignature(string actor, string rawSig, string method, string path, string queryString, Dictionary<string, string> requestHeaders, string body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task ExecuteAsync(IEnumerable<ExtractedTweet> tweets, Follower foll
var note = _statusService.GetStatus(user.Acct, tweet);
var result = await _activityPubService.PostNewNoteActivity(note, user.Acct, tweet.Id.ToString(), follower.Host, inbox);

if (result == HttpStatusCode.Accepted)
if (result == HttpStatusCode.Accepted || result == HttpStatusCode.OK)
syncStatus = tweet.Id;
else
throw new Exception("Posting new note activity failed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task ExecuteAsync(ExtractedTweet[] tweets, SyncTwitterUser user, st
var result =
await _activityPubService.PostNewNoteActivity(note, user.Acct, tweet.Id.ToString(), host, inbox);

if (result == HttpStatusCode.Accepted)
if (result == HttpStatusCode.Accepted || result == HttpStatusCode.OK)
syncStatus = tweet.Id;
else
throw new Exception("Posting new note activity failed");
Expand Down
2 changes: 1 addition & 1 deletion src/BirdsiteLive/BirdsiteLive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>d21486de-a812-47eb-a419-05682bb68856</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Version>0.3.1</Version>
<Version>0.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 4197b9b

Please sign in to comment.