better json parsing and response handling
This commit is contained in:
parent
047abd92f8
commit
608077cd22
3 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ namespace BirdsiteLive.ActivityPub
|
||||||
public class Activity
|
public class Activity
|
||||||
{
|
{
|
||||||
[JsonProperty("@context")]
|
[JsonProperty("@context")]
|
||||||
public string context { get; set; }
|
public object context { get; set; }
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
public string type { get; set; }
|
public string type { get; set; }
|
||||||
public string actor { get; set; }
|
public string actor { get; set; }
|
||||||
|
|
|
@ -115,7 +115,7 @@ namespace BirdsiteLive.Domain
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var result = await _activityPubService.PostDataAsync(acceptFollow, followerHost, activity.apObject);
|
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)
|
private string OnlyKeepRoute(string inbox, string host)
|
||||||
|
@ -159,7 +159,7 @@ namespace BirdsiteLive.Domain
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var result = await _activityPubService.PostDataAsync(acceptFollow, followerHost, activity.apObject.apObject);
|
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)
|
private async Task<SignatureValidationResult> ValidateSignature(string actor, string rawSig, string method, string path, string queryString, Dictionary<string, string> requestHeaders, string body)
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace BirdsiteLive.Pipeline.Processors.SubTasks
|
||||||
var result =
|
var result =
|
||||||
await _activityPubService.PostNewNoteActivity(note, user.Acct, tweet.Id.ToString(), host, inbox);
|
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;
|
syncStatus = tweet.Id;
|
||||||
else
|
else
|
||||||
throw new Exception("Posting new note activity failed");
|
throw new Exception("Posting new note activity failed");
|
||||||
|
|
Loading…
Add table
Reference in a new issue