diff --git a/src/BirdsiteLive.Pipeline/Processors/Federation/SubTasks/SendTweetsTaskBase.cs b/src/BirdsiteLive.Pipeline/Processors/Federation/SubTasks/SendTweetsTaskBase.cs index 58ae052..1cb9be9 100644 --- a/src/BirdsiteLive.Pipeline/Processors/Federation/SubTasks/SendTweetsTaskBase.cs +++ b/src/BirdsiteLive.Pipeline/Processors/Federation/SubTasks/SendTweetsTaskBase.cs @@ -18,13 +18,13 @@ namespace BirdsiteLive.Pipeline.Processors.SubTasks protected async Task SaveSyncTweetAsync(string acct, long tweetId, string host, string inbox) { - var inboxUrl = $"https://{host}/{inbox.Trim('/')}"; var tweet = new SyncTweet { Acct = acct, TweetId = tweetId, PublishedAt = DateTime.UtcNow, - Inbox = inboxUrl + Inbox = inbox, + Host = host }; await _syncTweetsPostgresDal.SaveTweetAsync(tweet); } diff --git a/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToInboxTaskTests.cs b/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToInboxTaskTests.cs index 81361ed..76b7a7f 100644 --- a/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToInboxTaskTests.cs +++ b/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToInboxTaskTests.cs @@ -94,7 +94,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion @@ -257,7 +258,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion @@ -349,7 +351,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion @@ -444,7 +447,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); } @@ -546,7 +550,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId2 - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); diff --git a/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToSharedInboxTests.cs b/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToSharedInboxTests.cs index 5e61379..26db9f6 100644 --- a/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToSharedInboxTests.cs +++ b/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/SubTasks/SendTweetsToSharedInboxTests.cs @@ -115,7 +115,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion @@ -321,7 +322,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion @@ -434,7 +436,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion @@ -550,7 +553,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); } @@ -673,7 +677,8 @@ namespace BirdsiteLive.Pipeline.Tests.Processors.SubTasks .Setup(x => x.SaveTweetAsync( It.Is(y => y.Acct == twitterHandle && y.TweetId == tweetId2 - && y.Inbox == $"https://{host}{inbox}" + && y.Inbox == inbox + && y.Host == host && y.PublishedAt != default))) .ReturnsAsync(-1); #endregion