Skip to content

Commit ca63aa5

Browse files
committed
fix: lock comments
Fix #28
1 parent c707fea commit ca63aa5

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

ApplicationData/ApplicationData.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageReference Include="FruityFoundation.Base" Version="1.1.2" />
1717
<PackageReference Include="FruityFoundation.FsBase" Version="1.1.2" />
1818
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
19-
<PackageReference Include="SnooBrowser" Version="3.0.3" />
19+
<PackageReference Include="SnooBrowser" Version="3.1.0" />
2020
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
2121
</ItemGroup>
2222

BackgroundProcessor/BackgroundProcessor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="FruityFoundation.Base" Version="1.1.2" />
1414
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
15-
<PackageReference Include="SnooBrowser" Version="3.0.4" />
15+
<PackageReference Include="SnooBrowser" Version="3.1.0" />
1616
<PackageReference Include="SnooBrowser.Extensions.DependencyInjection" Version="3.0.4" />
1717
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
1818
</ItemGroup>

BackgroundProcessor/Processors/LinkProcessor.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ public async Task Process(CancellationToken cancellationToken)
6565
if (maybeExistingComment.HasValue)
6666
{
6767
var result = await _commentBrowser.EditComment(CommentThing.CreateFromShortId(maybeExistingComment.Value), message);
68-
await TryDistinguishAndStickyLogFailure(result.CommentId);
68+
await TryDistinguishStickyAndLockLogFailure(result.CommentId);
6969
}
7070
else
7171
{
7272
var result = await _commentBrowser.SubmitComment(LinkThing.CreateFromShortId(item.RedditPostId), message);
73-
await TryDistinguishAndStickyLogFailure(result.CommentId);
73+
await TryDistinguishStickyAndLockLogFailure(result.CommentId);
7474

7575
await RedditCommentProvider.CreateOrUpdateLinkedComment(tx, item.RedditPostId, result.CommentId.ShortId);
7676
}
@@ -126,11 +126,12 @@ static async IAsyncEnumerable<string> BuildSection(string heading, string prefix
126126
}
127127
}
128128

129-
private async Task TryDistinguishAndStickyLogFailure(CommentThing comment)
129+
private async Task TryDistinguishStickyAndLockLogFailure(CommentThing comment)
130130
{
131131
try
132132
{
133133
await _commentBrowser.DistinguishComment(comment, DistinguishType.Moderator, isSticky: true);
134+
await _commentBrowser.LockComment(comment);
134135
}
135136
catch (Exception ex)
136137
{

0 commit comments

Comments
 (0)