added replyTo infos in status

This commit is contained in:
Nicolas Constant 2020-08-01 00:32:04 -04:00
parent ce996c20b2
commit fce355c2e8
No known key found for this signature in database
GPG key ID: 1E9F677FB01A5688
3 changed files with 10 additions and 2 deletions

View file

@ -42,14 +42,20 @@ namespace BirdsiteLive.Domain
var extractedTags = _statusExtractor.ExtractTags(tweet.MessageContent); var extractedTags = _statusExtractor.ExtractTags(tweet.MessageContent);
string inReplyTo = null;
if (tweet.InReplyToStatusId != default)
inReplyTo = $"https://{_instanceSettings.Domain}/users/{tweet.InReplyToAccount}/statuses/{tweet.InReplyToStatusId}";
var note = new Note var note = new Note
{ {
id = $"{noteId}/activity", //id = $"{noteId}/activity",
id = $"{noteId}",
published = tweet.CreatedAt.ToString("s") + "Z", published = tweet.CreatedAt.ToString("s") + "Z",
url = noteUrl, url = noteUrl,
attributedTo = actorUrl, attributedTo = actorUrl,
inReplyTo = inReplyTo,
//to = new [] {to}, //to = new [] {to},
//cc = new [] { apPublic }, //cc = new [] { apPublic },

View file

@ -20,6 +20,7 @@ namespace BirdsiteLive.Twitter.Extractors
{ {
Id = tweet.Id, Id = tweet.Id,
InReplyToStatusId = tweet.InReplyToStatusId, InReplyToStatusId = tweet.InReplyToStatusId,
InReplyToAccount = tweet.InReplyToScreenName,
MessageContent = ExtractMessage(tweet), MessageContent = ExtractMessage(tweet),
Media = ExtractMedia(tweet.Media), Media = ExtractMedia(tweet.Media),
CreatedAt = tweet.CreatedAt CreatedAt = tweet.CreatedAt

View file

@ -10,5 +10,6 @@ namespace BirdsiteLive.Twitter.Models
public string MessageContent { get; set; } public string MessageContent { get; set; }
public ExtractedMedia[] Media { get; set; } public ExtractedMedia[] Media { get; set; }
public DateTime CreatedAt { get; set; } public DateTime CreatedAt { get; set; }
public string InReplyToAccount { get; set; }
} }
} }