• R/O
  • HTTP
  • SSH
  • HTTPS

open-tween: Commit

開発に使用するリポジトリ


Commit MetaInfo

Révisioneefa7bbc515d5c3b9f67c73cec4de4e3964f4a48 (tree)
l'heure2023-07-20 02:07:43
AuteurKimura Youichi <kim.upsilon@bucy...>
CommiterKimura Youichi

Message de Log

Merge branch 'develop' into release

Change Summary

Modification

--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,9 @@
11 更新履歴
22
3+==== Ver 3.7.1(2023/07/20)
4+ * FIX: Cookie使用時に複数回ツイートを投稿するとDelaying?のエラーが表示される不具合を修正
5+ * FIX: 自己リプライのスレッドに含まれるツイートを発言一覧で選択するとエラーが発生する不具合を修正
6+
37 ==== Ver 3.7.0(2023/07/19)
48 * NEW: Cookie使用時のツイート投稿・削除に対応
59 * NEW: Cookie使用時のリツイートおよびリツイートの取消に対応
--- a/OpenTween.Tests/Api/GraphQL/TimelineTweetTest.cs
+++ b/OpenTween.Tests/Api/GraphQL/TimelineTweetTest.cs
@@ -123,5 +123,18 @@ namespace OpenTween.Api.GraphQL
123123 Assert.Equal("1602775353088524288", post.StatusId.Id);
124124 Assert.Equal(357750891L, post.UserId);
125125 }
126+
127+ [Fact]
128+ public void ToStatus_WithTwitterPostFactory_SelfThread_Test()
129+ {
130+ var rootElm = this.LoadResponseDocument("TimelineTweet_SelfThread.json");
131+ var timelineTweet = new TimelineTweet(rootElm);
132+ var status = timelineTweet.ToTwitterStatus();
133+ var postFactory = new TwitterPostFactory(this.CreateTabInfo());
134+ var post = postFactory.CreateFromStatus(status, selfUserId: 1L, new HashSet<long>());
135+
136+ Assert.Equal("1511751702684499968", post.StatusId.Id);
137+ Assert.Equal(40480664L, post.UserId);
138+ }
126139 }
127140 }
--- a/OpenTween.Tests/OpenTween.Tests.csproj
+++ b/OpenTween.Tests/OpenTween.Tests.csproj
@@ -82,5 +82,8 @@
8282 <None Update="Resources\Responses\TweetDetail.json">
8383 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
8484 </None>
85+ <None Update="Resources\Responses\TimelineTweet_SelfThread.json">
86+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
87+ </None>
8588 </ItemGroup>
8689 </Project>
--- /dev/null
+++ b/OpenTween.Tests/Resources/Responses/TimelineTweet_SelfThread.json
@@ -0,0 +1,124 @@
1+{
2+ "itemType": "TimelineTweet",
3+ "__typename": "TimelineTweet",
4+ "tweet_results": {
5+ "result": {
6+ "__typename": "Tweet",
7+ "rest_id": "1511751702684499968",
8+ "has_birdwatch_notes": false,
9+ "core": {
10+ "user_results": {
11+ "result": {
12+ "__typename": "User",
13+ "id": "VXNlcjo0MDQ4MDY2NA==",
14+ "rest_id": "40480664",
15+ "affiliates_highlighted_label": {},
16+ "has_graduated_access": true,
17+ "is_blue_verified": false,
18+ "profile_image_shape": "Circle",
19+ "legacy": {
20+ "followed_by": true,
21+ "following": true,
22+ "can_dm": true,
23+ "can_media_tag": true,
24+ "created_at": "Sat May 16 15:20:01 +0000 2009",
25+ "default_profile": false,
26+ "default_profile_image": false,
27+ "description": "OpenTween Project 言い出しっぺ",
28+ "entities": {
29+ "description": {
30+ "urls": []
31+ },
32+ "url": {
33+ "urls": [
34+ {
35+ "display_url": "m.upsilo.net/@upsilon",
36+ "expanded_url": "https://m.upsilo.net/@upsilon",
37+ "url": "https://t.co/vNMmyHHOQD",
38+ "indices": [
39+ 0,
40+ 23
41+ ]
42+ }
43+ ]
44+ }
45+ },
46+ "fast_followers_count": 0,
47+ "favourites_count": 216205,
48+ "followers_count": 1304,
49+ "friends_count": 917,
50+ "has_custom_timelines": false,
51+ "is_translator": false,
52+ "listed_count": 92,
53+ "location": "Funabashi, Chiba, Japan",
54+ "media_count": 1040,
55+ "name": "upsilon",
56+ "normal_followers_count": 1304,
57+ "pinned_tweet_ids_str": [],
58+ "possibly_sensitive": false,
59+ "profile_banner_url": "https://pbs.twimg.com/profile_banners/40480664/1349188016",
60+ "profile_image_url_https": "https://pbs.twimg.com/profile_images/719076434/____normal.png",
61+ "profile_interstitial_type": "",
62+ "screen_name": "kim_upsilon",
63+ "statuses_count": 10096,
64+ "translator_type": "regular",
65+ "url": "https://t.co/vNMmyHHOQD",
66+ "verified": false,
67+ "want_retweets": true,
68+ "withheld_in_countries": []
69+ }
70+ }
71+ }
72+ },
73+ "edit_control": {
74+ "edit_tweet_ids": [
75+ "1511751702684499968"
76+ ],
77+ "editable_until_msecs": "1649266467565",
78+ "is_edit_eligible": true,
79+ "edits_remaining": "5"
80+ },
81+ "edit_perspective": {
82+ "favorited": false,
83+ "retweeted": false
84+ },
85+ "is_translatable": true,
86+ "views": {
87+ "state": "Enabled"
88+ },
89+ "source": "<a href=\"https://www.opentween.org/\" rel=\"nofollow\">OpenTween (dev)</a>",
90+ "legacy": {
91+ "bookmark_count": 0,
92+ "bookmarked": false,
93+ "created_at": "Wed Apr 06 17:04:27 +0000 2022",
94+ "conversation_id_str": "1511751702684499968",
95+ "display_text_range": [
96+ 0,
97+ 45
98+ ],
99+ "entities": {
100+ "user_mentions": [],
101+ "urls": [],
102+ "hashtags": [],
103+ "symbols": []
104+ },
105+ "favorite_count": 1,
106+ "favorited": false,
107+ "full_text": "OpenTweenそろそろ次のリリースしたいんだけど今のAPI規制下で出してもねえ、という",
108+ "is_quote_status": false,
109+ "lang": "ja",
110+ "quote_count": 0,
111+ "reply_count": 1,
112+ "retweet_count": 0,
113+ "retweeted": false,
114+ "user_id_str": "40480664",
115+ "id_str": "1511751702684499968"
116+ },
117+ "quick_promote_eligibility": {
118+ "eligibility": "IneligibleNotProfessional"
119+ }
120+ }
121+ },
122+ "tweetDisplayType": "SelfThread",
123+ "hasModeratedReplies": false
124+}
--- a/OpenTween/Api/GraphQL/TimelineTweet.cs
+++ b/OpenTween/Api/GraphQL/TimelineTweet.cs
@@ -156,7 +156,7 @@ namespace OpenTween.Api.GraphQL
156156
157157 public static TimelineTweet[] ExtractTimelineTweets(XElement element)
158158 {
159- return element.XPathSelectElements($"//itemContent[itemType[text()='{TypeName}']][tweetDisplayType[text()='Tweet']]")
159+ return element.XPathSelectElements($"//itemContent[itemType[text()='{TypeName}']][tweetDisplayType[text()='Tweet' or text()='SelfThread']]")
160160 .Select(x => new TimelineTweet(x))
161161 .ToArray();
162162 }
--- a/OpenTween/Properties/AssemblyInfo.cs
+++ b/OpenTween/Properties/AssemblyInfo.cs
@@ -22,7 +22,7 @@ using System.Runtime.InteropServices;
2222 // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
2323 [assembly: Guid("2d0ae0ba-adac-49a2-9b10-26fd69e695bf")]
2424
25-[assembly: AssemblyVersion("3.7.0.0")]
25+[assembly: AssemblyVersion("3.7.1.0")]
2626
2727 [assembly: InternalsVisibleTo("OpenTween.Tests")]
2828 [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // for Moq
--- a/OpenTween/Properties/Resources.Designer.cs
+++ b/OpenTween/Properties/Resources.Designer.cs
@@ -580,6 +580,10 @@ namespace OpenTween.Properties {
580580 /// <summary>
581581 /// 更新履歴
582582 ///
583+ ///==== Ver 3.7.1(2023/07/20)
584+ /// * FIX: Cookie使用時に複数回ツイートを投稿するとDelaying?のエラーが表示される不具合を修正
585+ /// * FIX: 自己リプライのスレッドに含まれるツイートを発言一覧で選択するとエラーが発生する不具合を修正
586+ ///
583587 ///==== Ver 3.7.0(2023/07/19)
584588 /// * NEW: Cookie使用時のツイート投稿・削除に対応
585589 /// * NEW: Cookie使用時のリツイートおよびリツイートの取消に対応
@@ -589,12 +593,7 @@ namespace OpenTween.Properties {
589593 /// * CHG: Google画像検索のURLの変更に対応
590594 /// * FIX: 発言一覧でDMを選択中に発言詳細部の日時ラベルをクリックするとエラーが発生する不具合を修正
591595 /// * FIX: Cookie使用時に「Listの発言取得に公式RTを含める」の設定が適用されない不具合を修正
592- ///
593- ///==== Ver 3.6.2(2023/07/07)
594- /// * FIX: リプライ制限されたツイートのRTがリストのタイムラインに含まれているとエラーになる不具合を修正
595- ///
596- ///==== Ver 3.6.1(2023/07/07)
597- /// * CHG: graphqlエンドポイントからのレス [残りの文字列は切り詰められました]&quot;; に類似しているローカライズされた文字列を検索します。
596+ /// [残りの文字列は切り詰められました]&quot;; に類似しているローカライズされた文字列を検索します。
598597 /// </summary>
599598 internal static string ChangeLog {
600599 get {
--- a/OpenTween/Twitter.cs
+++ b/OpenTween/Twitter.cs
@@ -174,7 +174,7 @@ namespace OpenTween
174174
175175 private readonly TwitterPostFactory postFactory;
176176
177- private long previousStatusId = -1L;
177+ private string? previousStatusId = null;
178178
179179 public Twitter(TwitterApi api)
180180 {
@@ -286,10 +286,10 @@ namespace OpenTween
286286
287287 this.UpdateUserStats(status.User);
288288
289- if (status.Id == this.previousStatusId)
289+ if (status.IdStr == this.previousStatusId)
290290 throw new WebApiException("OK:Delaying?");
291291
292- this.previousStatusId = status.Id;
292+ this.previousStatusId = status.IdStr;
293293
294294 // 投稿したものを返す
295295 var post = this.CreatePostsFromStatusData(status);
@@ -689,7 +689,9 @@ namespace OpenTween
689689 FocalTweetId = id,
690690 };
691691 var tweets = await request.Send(this.Api.Connection).ConfigureAwait(false);
692- status = tweets.Select(x => x.ToTwitterStatus()).Where(x => x.IdStr == id.Id).First();
692+ status = tweets.Select(x => x.ToTwitterStatus())
693+ .Where(x => x.IdStr == id.Id)
694+ .FirstOrDefault() ?? throw new WebApiException("Empty result set");
693695 }
694696 else
695697 {
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
1-version: 3.6.2.{build}
1+version: 3.7.0.{build}
22
33 os: Visual Studio 2022
44
Afficher sur ancien navigateur de dépôt.