a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[sln] Code cleanup

+31 -19
+1
.idea/.idea.Iceshrimp.NET/.idea/codeStyles/codeStyleConfig.xml
··· 1 1 <component name="ProjectCodeStyleConfiguration"> 2 2 <state> 3 + <option name="USE_PER_PROJECT_SETTINGS" value="true" /> 3 4 <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> 4 5 </state> 5 6 </component>
+2
Iceshrimp.Backend/Core/Federation/ActivityStreams/LdHelpers.cs
··· 1 1 using System.Collections.Concurrent; 2 + using System.Diagnostics.CodeAnalysis; 2 3 using Iceshrimp.Backend.Core.Configuration; 3 4 using Iceshrimp.Backend.Core.Database.Tables; 4 5 using Iceshrimp.Backend.Core.Federation.ActivityStreams.Types; ··· 66 67 Document = GetPreloadedDocument(filename) 67 68 }; 68 69 70 + [SuppressMessage("ReSharper", "ExplicitCallerInfoArgument", Justification = "CustomLoader is not clear enough")] 69 71 private static RemoteDocument CustomLoader(Uri uri, JsonLdLoaderOptions jsonLdLoaderOptions) 70 72 { 71 73 using var activity = Telemetry.ActivitySource.StartActivity("Load Context");
+1 -1
Iceshrimp.Backend/Pages/FederationList.razor.cs
··· 52 52 { 53 53 List = await Database.AllowedInstances 54 54 .OrderBy(p => p.Host) 55 - .ToDictionaryAsync(p => p.Host, p => ""); 55 + .ToDictionaryAsync(p => p.Host, _ => ""); 56 56 } 57 57 else 58 58 {
+1 -1
Iceshrimp.Frontend/Components/AnnouncementsDialog.razor
··· 55 55 @if (Announcements.Count != 1) 56 56 { 57 57 <button class="button" @onclick="Previous" 58 - disabled="@(Current == 0 && NextButton?.State != StateButton.StateEnum.Loading)"> 58 + disabled="@(Current == 0 && NextButton.State != StateButton.StateEnum.Loading)"> 59 59 <Icon Name="Icons.CaretLeft"/> 60 60 @Loc["Previous"] 61 61 </button>
+4 -4
Iceshrimp.Frontend/Components/ProfileInfo.razor
··· 86 86 <MenuElement Icon="Icons.Info" OnSelect="OpenAbout"> 87 87 <Text>@Loc["About"]</Text> 88 88 </MenuElement> 89 - @if (User.Host != null && UserProfile?.Url != null) 89 + @if (User.Host != null && UserProfile.Url != null) 90 90 { 91 91 <MenuElement Icon="Icons.ArrowSquareOut" OnSelect="OpenOriginal"> 92 92 <Text>@Loc["Open original page"]</Text> ··· 95 95 <MenuElement Icon="Icons.Share" OnSelect="CopyLink"> 96 96 <Text>@Loc["Copy link"]</Text> 97 97 </MenuElement> 98 - @if (User.Host != null && UserProfile?.Url != null) 98 + @if (User.Host != null && UserProfile.Url != null) 99 99 { 100 100 <MenuElement Icon="Icons.ShareNetwork" OnSelect="CopyLinkRemote"> 101 101 <Text>@Loc["Copy link (remote)"]</Text> ··· 116 116 <Text>@Loc["Copy RSS feed"]</Text> 117 117 </MenuElement> 118 118 } 119 - @if (UserProfile != null && !UserProfile.Relations.HasFlag(Relations.Self)) 119 + @if (!UserProfile.Relations.HasFlag(Relations.Self)) 120 120 { 121 121 <hr class="rule"/> 122 122 @if (UserProfile.Relations.HasFlag(Relations.Muting)) ··· 287 287 } 288 288 289 289 private void TemporaryMute() => 290 - GlobalComponentSvc.SelectDialog?.Select(new EventCallback<object?>(this, TemporaryMuteCallback), Loc["Mute {0}?", User.DisplayName ?? User.Username], [(Loc["For 1 hour"], (object)DateTime.Now.AddHours(1)), (Loc["For {0} hours", 3], (object)DateTime.Now.AddHours(3)), (Loc["For {0} hours", 8], (object)DateTime.Now.AddHours(8)), (Loc["For 1 day"], (object)DateTime.Now.AddDays(1)), (Loc["For 1 week"], (object)DateTime.Now.AddDays(7))], Loc["Mute"]); 290 + GlobalComponentSvc.SelectDialog?.Select(new EventCallback<object?>(this, TemporaryMuteCallback), Loc["Mute {0}?", User.DisplayName ?? User.Username], [(Loc["For 1 hour"], DateTime.Now.AddHours(1)), (Loc["For {0} hours", 3], DateTime.Now.AddHours(3)), (Loc["For {0} hours", 8], DateTime.Now.AddHours(8)), (Loc["For 1 day"], DateTime.Now.AddDays(1)), (Loc["For 1 week"], DateTime.Now.AddDays(7))], Loc["Mute"]); 291 291 292 292 private async Task TemporaryMuteCallback(object? value) 293 293 {
+1 -1
Iceshrimp.Frontend/Components/ReportDialog.razor
··· 173 173 { 174 174 if (ReportedUser == null) return; 175 175 176 - if (Uri.TryCreate(NewNoteId, UriKind.Absolute, out var uri)) 176 + if (Uri.TryCreate(NewNoteId, UriKind.Absolute, out _)) 177 177 { 178 178 var res = await Api.Search.LookupAsync(NewNoteId); 179 179
+14 -5
Iceshrimp.Frontend/Core/Services/AnnouncementService.cs
··· 1 1 using Iceshrimp.Frontend.Components; 2 - using Microsoft.AspNetCore.Components; 3 2 4 3 namespace Iceshrimp.Frontend.Core.Services; 5 4 6 - internal class AnnouncementService 5 + internal class AnnouncementService : IDisposable, IAsyncDisposable 7 6 { 8 - public AnnouncementsDialog? AnnouncementsDialog { get; set; } 9 - private UpdateService _update; 10 - private Timer _timer; 7 + public AnnouncementsDialog? AnnouncementsDialog { get; set; } 8 + private readonly UpdateService _update; 9 + private Timer _timer; 11 10 12 11 public AnnouncementService(UpdateService updateService) 13 12 { ··· 25 24 // Don't show announcements if updates are available 26 25 if (_update.DialogOpen) return; 27 26 await AnnouncementsDialog?.Display()!; 27 + } 28 + 29 + public void Dispose() 30 + { 31 + _timer.Dispose(); 32 + } 33 + 34 + public async ValueTask DisposeAsync() 35 + { 36 + await _timer.DisposeAsync(); 28 37 } 29 38 }
+7 -7
Iceshrimp.Frontend/Layout/Sidebar.razor
··· 129 129 <Compose @ref="_compose"/> 130 130 131 131 @code { 132 - private Compose _compose = null!; 133 - private bool _open; 134 - private ElementReference SidebarElementRef { get; set; } 135 - private StatusResponse? Status { get; set; } 136 - private AccountDropdown _accountDropdown = null!; 137 - private ElementReference _avatar; 138 - private Timer _timer; 132 + private Compose _compose = null!; 133 + private bool _open; 134 + private StatusResponse? Status { get; set; } 135 + private AccountDropdown _accountDropdown = null!; 136 + private ElementReference _avatar; 137 + private readonly Timer _timer; 139 138 140 139 public Sidebar() 141 140 { ··· 193 192 public void Dispose() 194 193 { 195 194 Navigation.LocationChanged -= HandleLocationChanged; 195 + _timer.Dispose(); 196 196 } 197 197 }