From f47333b768029770ee0edd11714149a675b805b3 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Sat, 16 Dec 2023 01:42:47 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=20v3.10.1-dev=20=E9=96=8B=E7=99=BA=E9=96=8B=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.txt | 2 ++ OpenTween/Properties/AssemblyInfo.cs | 2 +- OpenTween/Properties/Resources.Designer.cs | 5 +++-- appveyor.yml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 51ceeb19e..e1c1e5ad1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,7 @@ 更新履歴 +==== Unreleased + ==== Ver 3.10.0(2023/12/16) * NEW: graphqlエンドポイント経由で取得した引用ツイートの表示に対応 * FIX: APIリクエストがタイムアウトした場合のキャンセル処理を改善 diff --git a/OpenTween/Properties/AssemblyInfo.cs b/OpenTween/Properties/AssemblyInfo.cs index 9b3383696..ed1d2b71a 100644 --- a/OpenTween/Properties/AssemblyInfo.cs +++ b/OpenTween/Properties/AssemblyInfo.cs @@ -22,7 +22,7 @@ // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です [assembly: Guid("2d0ae0ba-adac-49a2-9b10-26fd69e695bf")] -[assembly: AssemblyVersion("3.10.0.0")] +[assembly: AssemblyVersion("3.10.0.1")] [assembly: InternalsVisibleTo("OpenTween.Tests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // for Moq diff --git a/OpenTween/Properties/Resources.Designer.cs b/OpenTween/Properties/Resources.Designer.cs index aebbd9b49..da3b85592 100644 --- a/OpenTween/Properties/Resources.Designer.cs +++ b/OpenTween/Properties/Resources.Designer.cs @@ -580,6 +580,8 @@ internal static string ChangeIconToolStripMenuItem_Confirm { /// /// 更新履歴 /// + ///==== Unreleased + /// ///==== Ver 3.10.0(2023/12/16) /// * NEW: graphqlエンドポイント経由で取得した引用ツイートの表示に対応 /// * FIX: APIリクエストがタイムアウトした場合のキャンセル処理を改善 @@ -593,8 +595,7 @@ internal static string ChangeIconToolStripMenuItem_Confirm { /// ///==== Ver 3.8.0(2023/11/29) /// * NEW: graphqlエンドポイントを使用した検索タイムラインの取得に対応 - /// * NEW: graphqlエンドポイントを使用したプロフィール情報の取得に対応 - /// * NEW: graphq [残りの文字列は切り詰められました]"; に類似しているローカライズされた文字列を検索します。 + /// * NEW: graphqlエンドポイントを使用したプロフィール情報の取得 [残りの文字列は切り詰められました]"; に類似しているローカライズされた文字列を検索します。 /// internal static string ChangeLog { get { diff --git a/appveyor.yml b/appveyor.yml index 1893d8839..fb643672c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.9.0.{build} +version: 3.10.0.{build} os: Visual Studio 2022 From 197a1b85262f3bbd5344030d59035bca9906efdd Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Fri, 22 Dec 2023 23:13:35 +0900 Subject: [PATCH 2/5] =?UTF-8?q?TimelineReplaceEntry=E3=81=A7cursor?= =?UTF-8?q?=E3=81=8C=E6=9B=B4=E6=96=B0=E3=81=95=E3=82=8C=E3=82=8B=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC=E3=82=B9=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api/GraphQL/SearchTimelineRequestTest.cs | 22 ++++++++++ .../SearchTimeline_ReplaceCursor.json | 40 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 OpenTween.Tests/Resources/Responses/SearchTimeline_ReplaceCursor.json diff --git a/OpenTween.Tests/Api/GraphQL/SearchTimelineRequestTest.cs b/OpenTween.Tests/Api/GraphQL/SearchTimelineRequestTest.cs index 7003b27c3..7e960eb4f 100644 --- a/OpenTween.Tests/Api/GraphQL/SearchTimelineRequestTest.cs +++ b/OpenTween.Tests/Api/GraphQL/SearchTimelineRequestTest.cs @@ -62,6 +62,28 @@ public async Task Send_Test() mock.VerifyAll(); } + [Fact] + public async Task Send_ReplaceCursorTest() + { + using var apiResponse = await TestUtils.CreateApiResponse("Resources/Responses/SearchTimeline_ReplaceCursor.json"); + + var mock = new Mock(); + mock.Setup(x => x.SendAsync(It.IsAny())) + .ReturnsAsync(apiResponse); + + var request = new SearchTimelineRequest(rawQuery: "#OpenTween") + { + Count = 20, + }; + + var response = await request.Send(mock.Object); + Assert.Empty(response.Tweets); + Assert.Equal("DAADDAABCgABFnlh4hraMAYKAAIOTm0DEhTAAQAIAAIAAAABCAADAAAAAQgABAAAAAAKAAUX8j3ezIBOIAoABhfyPd7Mf9jwAAA", response.CursorTop); + Assert.Equal("DAADDAABCgABFnlh4hraMAYKAAIOTm0DEhTAAQAIAAIAAAACCAADAAAAAQgABAAAAAAKAAUX8j3ezIBOIAoABhfyPd7Mf9jwAAA", response.CursorBottom); + + mock.VerifyAll(); + } + [Fact] public async Task Send_RequestCursor_Test() { diff --git a/OpenTween.Tests/Resources/Responses/SearchTimeline_ReplaceCursor.json b/OpenTween.Tests/Resources/Responses/SearchTimeline_ReplaceCursor.json new file mode 100644 index 000000000..a4d866f4b --- /dev/null +++ b/OpenTween.Tests/Resources/Responses/SearchTimeline_ReplaceCursor.json @@ -0,0 +1,40 @@ +{ + "data": { + "search_by_raw_query": { + "search_timeline": { + "timeline": { + "instructions": [ + { + "type": "TimelineReplaceEntry", + "entry_id_to_replace": "cursor-top-9223372036854775807", + "entry": { + "entryId": "cursor-top-9223372036854775807", + "sortIndex": "9223372036854775807", + "content": { + "entryType": "TimelineTimelineCursor", + "__typename": "TimelineTimelineCursor", + "value": "DAADDAABCgABFnlh4hraMAYKAAIOTm0DEhTAAQAIAAIAAAABCAADAAAAAQgABAAAAAAKAAUX8j3ezIBOIAoABhfyPd7Mf9jwAAA", + "cursorType": "Top" + } + } + }, + { + "type": "TimelineReplaceEntry", + "entry_id_to_replace": "cursor-bottom-0", + "entry": { + "entryId": "cursor-bottom-0", + "sortIndex": "0", + "content": { + "entryType": "TimelineTimelineCursor", + "__typename": "TimelineTimelineCursor", + "value": "DAADDAABCgABFnlh4hraMAYKAAIOTm0DEhTAAQAIAAIAAAACCAADAAAAAQgABAAAAAAKAAUX8j3ezIBOIAoABhfyPd7Mf9jwAAA", + "cursorType": "Bottom" + } + } + } + ] + } + } + } + } +} From d3f02ed830fb583d7a286e034cfe683c425a9aa8 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Fri, 22 Dec 2023 23:37:05 +0900 Subject: [PATCH 3/5] =?UTF-8?q?ApiResponse,=20LazyJson=E3=81=AEDispose?= =?UTF-8?q?=E6=BC=8F=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenTween/Api/TwitterApi.cs | 2 +- OpenTween/Twitter.cs | 14 +++++++------- OpenTween/UserInfoDialog.cs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenTween/Api/TwitterApi.cs b/OpenTween/Api/TwitterApi.cs index f1186b1e7..b8e46a72e 100644 --- a/OpenTween/Api/TwitterApi.cs +++ b/OpenTween/Api/TwitterApi.cs @@ -640,7 +640,7 @@ public async Task> DirectMessagesEventsNew(l JsonString = json, }; - var response = await this.Connection.SendAsync(request) + using var response = await this.Connection.SendAsync(request) .ConfigureAwait(false); return response.ReadAsLazyJson(); diff --git a/OpenTween/Twitter.cs b/OpenTween/Twitter.cs index ba09b07b8..341b69631 100644 --- a/OpenTween/Twitter.cs +++ b/OpenTween/Twitter.cs @@ -260,7 +260,7 @@ await this.SendDirectMessage(param.Text, mediaId) } else { - var response = await this.Api.StatusesUpdate( + using var response = await this.Api.StatusesUpdate( param.Text, param.InReplyToStatusId?.ToTwitterStatusId(), param.MediaIds, @@ -317,7 +317,7 @@ public async Task UploadMedia(IMediaItem item, string? mediaCategory = nul _ => "application/octet-stream", }; - var initResponse = await this.Api.MediaUploadInit(item.Size, mediaType, mediaCategory) + using var initResponse = await this.Api.MediaUploadInit(item.Size, mediaType, mediaCategory) .ConfigureAwait(false); var initMedia = await initResponse.LoadJsonAsync() @@ -328,7 +328,7 @@ public async Task UploadMedia(IMediaItem item, string? mediaCategory = nul await this.Api.MediaUploadAppend(mediaId, 0, item) .ConfigureAwait(false); - var response = await this.Api.MediaUploadFinalize(mediaId) + using var response = await this.Api.MediaUploadFinalize(mediaId) .ConfigureAwait(false); var media = await response.LoadJsonAsync() @@ -374,7 +374,7 @@ public async Task SendDirectMessage(string postStr, long? mediaId = null) var recipient = await this.GetUserInfo(recipientName) .ConfigureAwait(false); - var response = await this.Api.DirectMessagesEventsNew(recipient.Id, body, mediaId) + using var response = await this.Api.DirectMessagesEventsNew(recipient.Id, body, mediaId) .ConfigureAwait(false); var messageEventSingle = await response.LoadJsonAsync() @@ -405,7 +405,7 @@ await this.CreateDirectMessagesEventFromJson(messageEventSingle, read: true) return null; } - var response = await this.Api.StatusesRetweet(target.ToTwitterStatusId()) + using var response = await this.Api.StatusesRetweet(target.ToTwitterStatusId()) .ConfigureAwait(false); var status = await response.LoadJsonAsync() @@ -1324,7 +1324,7 @@ await this.Api.ListsDestroy(listId) public async Task EditList(long listId, string new_name, bool isPrivate, string description) { - var response = await this.Api.ListsUpdate(listId, new_name, description, isPrivate) + using var response = await this.Api.ListsUpdate(listId, new_name, description, isPrivate) .ConfigureAwait(false); var list = await response.LoadJsonAsync() @@ -1349,7 +1349,7 @@ public async Task CreateListApi(string listName, bool isPrivate, string descript { this.CheckAccountState(); - var response = await this.Api.ListsCreate(listName, description, isPrivate) + using var response = await this.Api.ListsCreate(listName, description, isPrivate) .ConfigureAwait(false); var list = await response.LoadJsonAsync() diff --git a/OpenTween/UserInfoDialog.cs b/OpenTween/UserInfoDialog.cs index 176ac2e4d..3a98320d1 100644 --- a/OpenTween/UserInfoDialog.cs +++ b/OpenTween/UserInfoDialog.cs @@ -527,7 +527,7 @@ private async void ButtonEdit_Click(object sender, EventArgs e) { try { - var response = await this.twitterApi.AccountUpdateProfile( + using var response = await this.twitterApi.AccountUpdateProfile( this.TextBoxName.Text, this.TextBoxWeb.Text, this.TextBoxLocation.Text, From 96f6312b1b3468ad417aa7a2661457b29d92bf6a Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Sat, 23 Dec 2023 00:36:27 +0900 Subject: [PATCH 4/5] =?UTF-8?q?TwitterCredentialOAuth1=E3=81=AB=E6=B8=A1?= =?UTF-8?q?=E3=81=99=E5=BC=95=E6=95=B0=E3=81=AE=E8=AA=A4=E3=82=8A=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: b43c97bf ("ITwitterCredentialとアクセス手段ごとの具象クラスを追加") --- CHANGELOG.txt | 1 + OpenTween/Setting/SettingCommon.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e1c1e5ad1..69dcaf4df 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,7 @@ 更新履歴 ==== Unreleased + * FIX: OAuth 1.0a によるAPIアクセスに失敗する不具合を修正 ==== Ver 3.10.0(2023/12/16) * NEW: graphqlエンドポイント経由で取得した引用ツイートの表示に対応 diff --git a/OpenTween/Setting/SettingCommon.cs b/OpenTween/Setting/SettingCommon.cs index 488d926b2..c57f1ee2d 100644 --- a/OpenTween/Setting/SettingCommon.cs +++ b/OpenTween/Setting/SettingCommon.cs @@ -354,7 +354,7 @@ public class UserAccount public string Username = ""; public long UserId = 0; - public APIAuthType TwitterAuthType { get; set; } + public APIAuthType TwitterAuthType { get; set; } = APIAuthType.OAuth1; public string TwitterOAuth1ConsumerKey { get; set; } = ""; @@ -405,7 +405,7 @@ public ITwitterCredential GetTwitterCredential() return appToken.AuthType switch { APIAuthType.OAuth1 - => new TwitterCredentialOAuth1(appToken, this.TwitterOAuth1ConsumerKey, this.TwitterOAuth1ConsumerSecret), + => new TwitterCredentialOAuth1(appToken, this.Token, this.TokenSecret), APIAuthType.TwitterComCookie => new TwitterCredentialCookie(appToken), _ => new TwitterCredentialNone(), From fccfffae13b647b9d600e049dbf0d50a05de3939 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Sat, 23 Dec 2023 00:50:09 +0900 Subject: [PATCH 5/5] =?UTF-8?q?OpenTween=20v3.10.1=20=E3=83=AA=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.txt | 2 +- OpenTween/Properties/AssemblyInfo.cs | 2 +- OpenTween/Properties/Resources.Designer.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 69dcaf4df..5b94876bc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,6 @@ 更新履歴 -==== Unreleased +==== Ver 3.10.1(2023/12/23) * FIX: OAuth 1.0a によるAPIアクセスに失敗する不具合を修正 ==== Ver 3.10.0(2023/12/16) diff --git a/OpenTween/Properties/AssemblyInfo.cs b/OpenTween/Properties/AssemblyInfo.cs index ed1d2b71a..d01a31e19 100644 --- a/OpenTween/Properties/AssemblyInfo.cs +++ b/OpenTween/Properties/AssemblyInfo.cs @@ -22,7 +22,7 @@ // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です [assembly: Guid("2d0ae0ba-adac-49a2-9b10-26fd69e695bf")] -[assembly: AssemblyVersion("3.10.0.1")] +[assembly: AssemblyVersion("3.10.1.0")] [assembly: InternalsVisibleTo("OpenTween.Tests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // for Moq diff --git a/OpenTween/Properties/Resources.Designer.cs b/OpenTween/Properties/Resources.Designer.cs index da3b85592..72428ee55 100644 --- a/OpenTween/Properties/Resources.Designer.cs +++ b/OpenTween/Properties/Resources.Designer.cs @@ -580,7 +580,8 @@ internal static string ChangeIconToolStripMenuItem_Confirm { /// /// 更新履歴 /// - ///==== Unreleased + ///==== Ver 3.10.1(2023/12/23) + /// * FIX: OAuth 1.0a によるAPIアクセスに失敗する不具合を修正 /// ///==== Ver 3.10.0(2023/12/16) /// * NEW: graphqlエンドポイント経由で取得した引用ツイートの表示に対応 @@ -594,8 +595,7 @@ internal static string ChangeIconToolStripMenuItem_Confirm { /// - この問題が起きるユーザーのツイートが含まれているとタイムラインの読み込みに失敗する問題も改善されます /// ///==== Ver 3.8.0(2023/11/29) - /// * NEW: graphqlエンドポイントを使用した検索タイムラインの取得に対応 - /// * NEW: graphqlエンドポイントを使用したプロフィール情報の取得 [残りの文字列は切り詰められました]"; に類似しているローカライズされた文字列を検索します。 + /// * NEW: graphqlエンドポイントを使用した [残りの文字列は切り詰められました]"; に類似しているローカライズされた文字列を検索します。 /// internal static string ChangeLog { get {