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.

[backend/core] Improve poll voter count fallback

This should fix erroneous voter counts for polls from instances that don't return as:votersCount.

+11 -3
+11 -3
Iceshrimp.Backend/Core/Services/NoteService.cs
··· 623 623 note.Poll.Votes = poll.Votes == null! || poll.Votes.Count != poll.Choices.Count 624 624 ? poll.Choices.Select(_ => 0).ToList() 625 625 : poll.Votes; 626 - note.Poll.VotersCount = poll.VotersCount ?? note.Poll.VotersCount; 626 + note.Poll.VotersCount = 627 + poll.VotersCount ?? 628 + (note.Poll.VotersCount == null 629 + ? null 630 + : Math.Max(note.Poll.VotersCount.Value, note.Poll.Votes.Sum())); 627 631 } 628 632 else if (poll.Votes.Count == poll.Choices.Count) 629 633 { 630 - note.Poll.Votes = poll.Votes; 631 - note.Poll.VotersCount = poll.VotersCount ?? note.Poll.VotersCount; 634 + note.Poll.Votes = poll.Votes; 635 + note.Poll.VotersCount = 636 + poll.VotersCount ?? 637 + (note.Poll.VotersCount == null 638 + ? null 639 + : Math.Max(note.Poll.VotersCount.Value, note.Poll.Votes.Sum())); 632 640 } 633 641 } 634 642 else