Skip to content

Commit

Permalink
Merge pull request #365 from opentween/fix-favorites-tab
Browse files Browse the repository at this point in the history
Favoritesタブが空のまま更新されない不具合を修正
  • Loading branch information
upsilon authored Jun 12, 2024
2 parents 22ae58b + bf1696d commit b49b119
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
==== Unreleased
* NEW: Misskeyでのノート投稿時のファイル添付に対応しました
- 追加で必要な権限があるため、前バージョンから使用している Misskey アカウントは再度追加し直す必要があります
* FIX: Favoritesタブが空のまま更新されない不具合を修正

==== Ver 3.14.0(2024/06/11)
* NEW: メインアカウント以外のホームタイムライン表示に対応
Expand Down
2 changes: 1 addition & 1 deletion OpenTween/SocialProtocol/Twitter/TwitterGraphqlClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public async Task<TimelineResponse> GetFavoritesTimeline(int count, IQueryCursor
var cursorTop = response.CursorTop;
var cursorBottom = response.CursorBottom;

var posts = this.account.Legacy.CreatePostsFromJson(statuses, firstLoad);
var posts = this.account.Legacy.CreatePostsFromJson(statuses, firstLoad, favTweet: true);

var filter = new TimelineResponseFilter(this.account.AccountState);
posts = filter.Run(posts);
Expand Down
2 changes: 1 addition & 1 deletion OpenTween/SocialProtocol/Twitter/TwitterV1Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public async Task<TimelineResponse> GetFavoritesTimeline(int count, IQueryCursor
.ConfigureAwait(false);

var (cursorTop, cursorBottom) = GetCursorFromResponse(statuses);
var posts = this.account.Legacy.CreatePostsFromJson(statuses, firstLoad);
var posts = this.account.Legacy.CreatePostsFromJson(statuses, firstLoad, favTweet: true);

var filter = new TimelineResponseFilter(this.account.AccountState);
posts = filter.Run(posts);
Expand Down
5 changes: 4 additions & 1 deletion OpenTween/Twitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,11 @@ internal PostClass CreatePostsFromStatusData(TwitterStatus status, bool firstLoa
}

internal PostClass[] CreatePostsFromJson(TwitterStatus[] statuses, bool firstLoad)
=> this.CreatePostsFromJson(statuses, firstLoad, favTweet: false);

internal PostClass[] CreatePostsFromJson(TwitterStatus[] statuses, bool firstLoad, bool favTweet)
{
var posts = statuses.Select(x => this.CreatePostsFromStatusData(x, firstLoad)).ToArray();
var posts = statuses.Select(x => this.CreatePostsFromStatusData(x, firstLoad, favTweet)).ToArray();

TwitterPostFactory.AdjustSortKeyForPromotedPost(posts);

Expand Down

0 comments on commit b49b119

Please sign in to comment.