Skip to content

Commit

Permalink
Merge pull request #88 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
0.14.2 PR
  • Loading branch information
NicolasConstant authored Feb 11, 2021
2 parents e73d76b + d660dc9 commit f5fc24d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ private ExtractedTweet[] RetrieveNewTweets(SyncTwitterUser user)
{
var tweets = new ExtractedTweet[0];

// Don't retrieve TL if protected
var userView = _twitterUserService.GetUser(user.Acct);
if (userView == null || userView.Protected) return tweets;

try
{
if (user.LastTweetPostedId == -1)
Expand Down
2 changes: 1 addition & 1 deletion src/BirdsiteLive.Twitter/TwitterUserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public TwitterUser GetUser(string username)
Name = user.Name,
Description = description,
Url = $"https://twitter.com/{username}",
ProfileImageUrl = user.ProfileImageUrlFullSize,
ProfileImageUrl = user.ProfileImageUrlFullSize.Replace("http://", "https://"),
ProfileBackgroundImageUrl = user.ProfileBackgroundImageUrlHttps,
ProfileBannerURL = user.ProfileBannerURL,
Protected = user.Protected
Expand Down
2 changes: 1 addition & 1 deletion src/BirdsiteLive/BirdsiteLive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>d21486de-a812-47eb-a419-05682bb68856</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Version>0.14.1</Version>
<Version>0.14.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public async Task ProcessAsync_UserNotSync_Test()
.Returns(Task.CompletedTask);

var twitterUserServiceMock = new Mock<ICachedTwitterUserService>(MockBehavior.Strict);
twitterUserServiceMock
.Setup(x => x.GetUser(It.Is<string>(y => y == user1.Acct)))
.Returns(new TwitterUser {Protected = false});

var logger = new Mock<ILogger<RetrieveTweetsProcessor>>(MockBehavior.Strict);
#endregion
Expand Down Expand Up @@ -126,6 +129,9 @@ public async Task ProcessAsync_UserSync_Test()
var twitterUserDalMock = new Mock<ITwitterUserDal>(MockBehavior.Strict);

var twitterUserServiceMock = new Mock<ICachedTwitterUserService>(MockBehavior.Strict);
twitterUserServiceMock
.Setup(x => x.GetUser(It.Is<string>(y => y == user1.Acct)))
.Returns(new TwitterUser { Protected = false });

var logger = new Mock<ILogger<RetrieveTweetsProcessor>>(MockBehavior.Strict);
#endregion
Expand Down Expand Up @@ -193,6 +199,9 @@ public async Task ProcessAsync_UserPartiallySync_Test()
var twitterUserDalMock = new Mock<ITwitterUserDal>(MockBehavior.Strict);

var twitterUserServiceMock = new Mock<ICachedTwitterUserService>(MockBehavior.Strict);
twitterUserServiceMock
.Setup(x => x.GetUser(It.Is<string>(y => y == user1.Acct)))
.Returns(new TwitterUser { Protected = false });

var logger = new Mock<ILogger<RetrieveTweetsProcessor>>(MockBehavior.Strict);
#endregion
Expand Down

0 comments on commit f5fc24d

Please sign in to comment.