diff --git a/src/BirdsiteLive.Domain/StatusService.cs b/src/BirdsiteLive.Domain/StatusService.cs index 172a366..51cddfc 100644 --- a/src/BirdsiteLive.Domain/StatusService.cs +++ b/src/BirdsiteLive.Domain/StatusService.cs @@ -41,15 +41,21 @@ namespace BirdsiteLive.Domain var apPublic = "https://www.w3.org/ns/activitystreams#Public"; 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 { - id = $"{noteId}/activity", + //id = $"{noteId}/activity", + id = $"{noteId}", published = tweet.CreatedAt.ToString("s") + "Z", url = noteUrl, attributedTo = actorUrl, + inReplyTo = inReplyTo, //to = new [] {to}, //cc = new [] { apPublic }, diff --git a/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs b/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs index 7bdb67f..4a0892a 100644 --- a/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs +++ b/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs @@ -20,6 +20,7 @@ namespace BirdsiteLive.Twitter.Extractors { Id = tweet.Id, InReplyToStatusId = tweet.InReplyToStatusId, + InReplyToAccount = tweet.InReplyToScreenName, MessageContent = ExtractMessage(tweet), Media = ExtractMedia(tweet.Media), CreatedAt = tweet.CreatedAt diff --git a/src/BirdsiteLive.Twitter/Models/ExtractedTweet.cs b/src/BirdsiteLive.Twitter/Models/ExtractedTweet.cs index 82c67bd..0363973 100644 --- a/src/BirdsiteLive.Twitter/Models/ExtractedTweet.cs +++ b/src/BirdsiteLive.Twitter/Models/ExtractedTweet.cs @@ -10,5 +10,6 @@ namespace BirdsiteLive.Twitter.Models public string MessageContent { get; set; } public ExtractedMedia[] Media { get; set; } public DateTime CreatedAt { get; set; } + public string InReplyToAccount { get; set; } } } \ No newline at end of file