diff --git a/src/BirdsiteLive.ActivityPub/ApDeserializer.cs b/src/BirdsiteLive.ActivityPub/ApDeserializer.cs index e577fbb..17dadbe 100644 --- a/src/BirdsiteLive.ActivityPub/ApDeserializer.cs +++ b/src/BirdsiteLive.ActivityPub/ApDeserializer.cs @@ -41,7 +41,6 @@ namespace BirdsiteLive.ActivityPub } }; return acceptFollow; - break; } break; } diff --git a/src/BirdsiteLive.Domain/StatusService.cs b/src/BirdsiteLive.Domain/StatusService.cs index 4983de1..e25d52b 100644 --- a/src/BirdsiteLive.Domain/StatusService.cs +++ b/src/BirdsiteLive.Domain/StatusService.cs @@ -41,7 +41,6 @@ namespace BirdsiteLive.Domain var noteUrl = UrlFactory.GetNoteUrl(_instanceSettings.Domain, username, tweet.Id.ToString()); var to = $"{actorUrl}/followers"; - var apPublic = "https://www.w3.org/ns/activitystreams#Public"; var extractedTags = _statusExtractor.Extract(tweet.MessageContent); _statisticsHandler.ExtractedStatus(extractedTags.tags.Count(x => x.type == "Mention")); @@ -70,11 +69,9 @@ namespace BirdsiteLive.Domain attributedTo = actorUrl, inReplyTo = inReplyTo, - //to = new [] {to}, - //cc = new [] { apPublic }, to = new[] { to }, - //cc = new[] { apPublic }, + //cc = new[] { "https://www.w3.org/ns/activitystreams#Public" }, cc = new string[0], sensitive = false, diff --git a/src/BirdsiteLive/Controllers/DebugingController.cs b/src/BirdsiteLive/Controllers/DebugingController.cs index 977687c..ff8f0b4 100644 --- a/src/BirdsiteLive/Controllers/DebugingController.cs +++ b/src/BirdsiteLive/Controllers/DebugingController.cs @@ -69,7 +69,6 @@ namespace BirdsiteLive.Controllers var noteUrl = $"https://{_instanceSettings.Domain}/@{username}/{noteGuid}"; var to = $"{actor}/followers"; - var apPublic = "https://www.w3.org/ns/activitystreams#Public"; var now = DateTime.UtcNow; var nowString = now.ToString("s") + "Z"; @@ -82,7 +81,7 @@ namespace BirdsiteLive.Controllers actor = actor, published = nowString, to = new []{ to }, - //cc = new [] { apPublic }, + //cc = new [] { "https://www.w3.org/ns/activitystreams#Public" }, apObject = new Note() { id = noteId, @@ -92,7 +91,7 @@ namespace BirdsiteLive.Controllers url = noteUrl, attributedTo = actor, to = new[] { to }, - //cc = new [] { apPublic }, + //cc = new [] { "https://www.w3.org/ns/activitystreams#Public" }, sensitive = false, content = "

Woooot

", attachment = new Attachment[0], diff --git a/src/BirdsiteLive/Controllers/UsersController.cs b/src/BirdsiteLive/Controllers/UsersController.cs index 0fbefcd..a06b1e9 100644 --- a/src/BirdsiteLive/Controllers/UsersController.cs +++ b/src/BirdsiteLive/Controllers/UsersController.cs @@ -159,13 +159,11 @@ namespace BirdsiteLive.Controllers return Accepted(); } } - - return Accepted(); } [Route("/users/{id}/followers")] [HttpGet] - public async Task Followers(string id) + public IActionResult Followers(string id) { var r = Request.Headers["Accept"].First(); if (!r.Contains("application/activity+json")) return NotFound(); diff --git a/src/Tests/BirdsiteLive.Cryptography.Tests/MagicKeyTests.cs b/src/Tests/BirdsiteLive.Cryptography.Tests/MagicKeyTests.cs index d77b67a..413aa53 100644 --- a/src/Tests/BirdsiteLive.Cryptography.Tests/MagicKeyTests.cs +++ b/src/Tests/BirdsiteLive.Cryptography.Tests/MagicKeyTests.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; +using NuGet.Frameworks; namespace BirdsiteLive.Cryptography.Tests { @@ -7,13 +8,12 @@ namespace BirdsiteLive.Cryptography.Tests public class MagicKeyTests { [TestMethod] - public async Task Test() + public void Test() { var g = MagicKey.Generate(); - var magicKey = new MagicKey(g.PrivateKey); - + Assert.IsNotNull(magicKey); } } } \ No newline at end of file diff --git a/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/RetrieveTwitterUsersProcessorTests.cs b/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/RetrieveTwitterUsersProcessorTests.cs index 5600e1c..a504549 100644 --- a/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/RetrieveTwitterUsersProcessorTests.cs +++ b/src/Tests/BirdsiteLive.Pipeline.Tests/Processors/RetrieveTwitterUsersProcessorTests.cs @@ -48,9 +48,9 @@ namespace BirdsiteLive.Pipeline.Tests.Processors var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); processor.WaitFactor = 10; - processor.GetTwitterUsersAsync(buffer, CancellationToken.None); + var t = processor.GetTwitterUsersAsync(buffer, CancellationToken.None); - await Task.Delay(50); + await Task.WhenAny(t, Task.Delay(50)); #region Validations maxUsersNumberProviderMock.VerifyAll(); @@ -95,10 +95,10 @@ namespace BirdsiteLive.Pipeline.Tests.Processors var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); processor.WaitFactor = 2; - processor.GetTwitterUsersAsync(buffer, CancellationToken.None); - - await Task.Delay(300); + var t = processor.GetTwitterUsersAsync(buffer, CancellationToken.None); + await Task.WhenAny(t, Task.Delay(300)); + #region Validations maxUsersNumberProviderMock.VerifyAll(); twitterUserDalMock.VerifyAll(); @@ -142,9 +142,9 @@ namespace BirdsiteLive.Pipeline.Tests.Processors var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); processor.WaitFactor = 2; - processor.GetTwitterUsersAsync(buffer, CancellationToken.None); + var t = processor.GetTwitterUsersAsync(buffer, CancellationToken.None); - await Task.Delay(200); + await Task.WhenAny(t, Task.Delay(200)); #region Validations maxUsersNumberProviderMock.VerifyAll(); @@ -181,9 +181,9 @@ namespace BirdsiteLive.Pipeline.Tests.Processors var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); processor.WaitFactor = 1; - processor.GetTwitterUsersAsync(buffer, CancellationToken.None); + var t =processor.GetTwitterUsersAsync(buffer, CancellationToken.None); - await Task.Delay(50); + await Task.WhenAny(t, Task.Delay(50)); #region Validations maxUsersNumberProviderMock.VerifyAll();