diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9fdceda49..a2bf7fda0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,7 @@ 更新履歴 ==== Unreleased + * FIX: Cookie使用時に「Listの発言取得に公式RTを含める」の設定が適用されない不具合を修正 ==== Ver 3.15.0(2024/06/14) * NEW: Misskeyでのノート投稿時のファイル添付に対応しました diff --git a/OpenTween/SocialProtocol/Twitter/TimelineResponseFilter.cs b/OpenTween/SocialProtocol/Twitter/TimelineResponseFilter.cs index 016444752..287757c34 100644 --- a/OpenTween/SocialProtocol/Twitter/TimelineResponseFilter.cs +++ b/OpenTween/SocialProtocol/Twitter/TimelineResponseFilter.cs @@ -39,6 +39,8 @@ public class TimelineResponseFilter public bool IsHomeTimeline { get; set; } + public bool IncludeRts { get; set; } = true; + public TimelineResponseFilter(TwitterAccountState accountState) { this.accountState = accountState; @@ -56,6 +58,9 @@ public PostClass[] Run(PostClass[] posts) filteredPosts = this.FilterMutedUserPosts(filteredPosts); } + if (!this.IncludeRts) + filteredPosts = this.FilterRetweets(filteredPosts); + return filteredPosts.ToArray(); } @@ -85,5 +90,8 @@ private bool IsMutedPost(PostClass post) return false; } + + private IEnumerable FilterRetweets(IEnumerable posts) + => posts.Where(x => x.RetweetedId == null); } } diff --git a/OpenTween/SocialProtocol/Twitter/TwitterGraphqlClient.cs b/OpenTween/SocialProtocol/Twitter/TwitterGraphqlClient.cs index 84acb0f59..1c51788c1 100644 --- a/OpenTween/SocialProtocol/Twitter/TwitterGraphqlClient.cs +++ b/OpenTween/SocialProtocol/Twitter/TwitterGraphqlClient.cs @@ -33,6 +33,7 @@ using OpenTween.Api.GraphQL; using OpenTween.Api.TwitterV2; using OpenTween.Models; +using OpenTween.Setting; namespace OpenTween.SocialProtocol.Twitter { @@ -177,7 +178,10 @@ public async Task GetListTimeline(long listId, int count, IQue var posts = this.account.Legacy.CreatePostsFromJson(statuses, firstLoad); - var filter = new TimelineResponseFilter(this.account.AccountState); + var filter = new TimelineResponseFilter(this.account.AccountState) + { + IncludeRts = SettingManager.Instance.Common.IsListsIncludeRts, + }; posts = filter.Run(posts); return new(posts, cursorTop, cursorBottom);