clean up warnings

This commit is contained in:
Nicolas Constant 2021-02-14 12:28:38 -05:00
parent 5d2d5ffd52
commit 9b25a86d1d
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
6 changed files with 16 additions and 23 deletions

View File

@ -41,7 +41,6 @@ namespace BirdsiteLive.ActivityPub
} }
}; };
return acceptFollow; return acceptFollow;
break;
} }
break; break;
} }

View File

@ -41,7 +41,6 @@ namespace BirdsiteLive.Domain
var noteUrl = UrlFactory.GetNoteUrl(_instanceSettings.Domain, username, tweet.Id.ToString()); var noteUrl = UrlFactory.GetNoteUrl(_instanceSettings.Domain, username, tweet.Id.ToString());
var to = $"{actorUrl}/followers"; var to = $"{actorUrl}/followers";
var apPublic = "https://www.w3.org/ns/activitystreams#Public";
var extractedTags = _statusExtractor.Extract(tweet.MessageContent); var extractedTags = _statusExtractor.Extract(tweet.MessageContent);
_statisticsHandler.ExtractedStatus(extractedTags.tags.Count(x => x.type == "Mention")); _statisticsHandler.ExtractedStatus(extractedTags.tags.Count(x => x.type == "Mention"));
@ -70,11 +69,9 @@ namespace BirdsiteLive.Domain
attributedTo = actorUrl, attributedTo = actorUrl,
inReplyTo = inReplyTo, inReplyTo = inReplyTo,
//to = new [] {to},
//cc = new [] { apPublic },
to = new[] { to }, to = new[] { to },
//cc = new[] { apPublic }, //cc = new[] { "https://www.w3.org/ns/activitystreams#Public" },
cc = new string[0], cc = new string[0],
sensitive = false, sensitive = false,

View File

@ -69,7 +69,6 @@ namespace BirdsiteLive.Controllers
var noteUrl = $"https://{_instanceSettings.Domain}/@{username}/{noteGuid}"; var noteUrl = $"https://{_instanceSettings.Domain}/@{username}/{noteGuid}";
var to = $"{actor}/followers"; var to = $"{actor}/followers";
var apPublic = "https://www.w3.org/ns/activitystreams#Public";
var now = DateTime.UtcNow; var now = DateTime.UtcNow;
var nowString = now.ToString("s") + "Z"; var nowString = now.ToString("s") + "Z";
@ -82,7 +81,7 @@ namespace BirdsiteLive.Controllers
actor = actor, actor = actor,
published = nowString, published = nowString,
to = new []{ to }, to = new []{ to },
//cc = new [] { apPublic }, //cc = new [] { "https://www.w3.org/ns/activitystreams#Public" },
apObject = new Note() apObject = new Note()
{ {
id = noteId, id = noteId,
@ -92,7 +91,7 @@ namespace BirdsiteLive.Controllers
url = noteUrl, url = noteUrl,
attributedTo = actor, attributedTo = actor,
to = new[] { to }, to = new[] { to },
//cc = new [] { apPublic }, //cc = new [] { "https://www.w3.org/ns/activitystreams#Public" },
sensitive = false, sensitive = false,
content = "<p>Woooot</p>", content = "<p>Woooot</p>",
attachment = new Attachment[0], attachment = new Attachment[0],

View File

@ -159,13 +159,11 @@ namespace BirdsiteLive.Controllers
return Accepted(); return Accepted();
} }
} }
return Accepted();
} }
[Route("/users/{id}/followers")] [Route("/users/{id}/followers")]
[HttpGet] [HttpGet]
public async Task<IActionResult> Followers(string id) public IActionResult Followers(string id)
{ {
var r = Request.Headers["Accept"].First(); var r = Request.Headers["Accept"].First();
if (!r.Contains("application/activity+json")) return NotFound(); if (!r.Contains("application/activity+json")) return NotFound();

View File

@ -1,5 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using NuGet.Frameworks;
namespace BirdsiteLive.Cryptography.Tests namespace BirdsiteLive.Cryptography.Tests
{ {
@ -7,13 +8,12 @@ namespace BirdsiteLive.Cryptography.Tests
public class MagicKeyTests public class MagicKeyTests
{ {
[TestMethod] [TestMethod]
public async Task Test() public void Test()
{ {
var g = MagicKey.Generate(); var g = MagicKey.Generate();
var magicKey = new MagicKey(g.PrivateKey); var magicKey = new MagicKey(g.PrivateKey);
Assert.IsNotNull(magicKey);
} }
} }
} }

View File

@ -48,9 +48,9 @@ namespace BirdsiteLive.Pipeline.Tests.Processors
var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object);
processor.WaitFactor = 10; 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 #region Validations
maxUsersNumberProviderMock.VerifyAll(); maxUsersNumberProviderMock.VerifyAll();
@ -95,10 +95,10 @@ namespace BirdsiteLive.Pipeline.Tests.Processors
var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object);
processor.WaitFactor = 2; processor.WaitFactor = 2;
processor.GetTwitterUsersAsync(buffer, CancellationToken.None); var t = processor.GetTwitterUsersAsync(buffer, CancellationToken.None);
await Task.Delay(300);
await Task.WhenAny(t, Task.Delay(300));
#region Validations #region Validations
maxUsersNumberProviderMock.VerifyAll(); maxUsersNumberProviderMock.VerifyAll();
twitterUserDalMock.VerifyAll(); twitterUserDalMock.VerifyAll();
@ -142,9 +142,9 @@ namespace BirdsiteLive.Pipeline.Tests.Processors
var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object);
processor.WaitFactor = 2; 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 #region Validations
maxUsersNumberProviderMock.VerifyAll(); maxUsersNumberProviderMock.VerifyAll();
@ -181,9 +181,9 @@ namespace BirdsiteLive.Pipeline.Tests.Processors
var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object); var processor = new RetrieveTwitterUsersProcessor(twitterUserDalMock.Object, maxUsersNumberProviderMock.Object, loggerMock.Object);
processor.WaitFactor = 1; 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 #region Validations
maxUsersNumberProviderMock.VerifyAll(); maxUsersNumberProviderMock.VerifyAll();