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;
break;
}
break;
}

View file

@ -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,

View file

@ -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 = "<p>Woooot</p>",
attachment = new Attachment[0],

View file

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

View file

@ -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);
}
}
}

View file

@ -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();