OSDN Git Service

引用ツイートのURLがtextとquoted_status_permalinkの両方に含まれている場合を考慮
authorKimura Youichi <kim.upsilon@bucyou.net>
Sat, 19 May 2018 20:59:09 +0000 (05:59 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 19 May 2018 21:00:30 +0000 (06:00 +0900)
OpenTween/Twitter.cs

index b13f805..e881ddd 100644 (file)
@@ -820,8 +820,12 @@ namespace OpenTween
             }
             //HTMLに整形
             string textFromApi = post.TextFromApi;
+
             var quotedStatusLink = (status.RetweetedStatus ?? status).QuotedStatusPermalink;
 
+            if (quotedStatusLink != null && entities.Urls.Any(x => x.ExpandedUrl == quotedStatusLink.Expanded))
+                quotedStatusLink = null; // 移行期は entities.urls と quoted_status_permalink の両方に含まれる場合がある
+
             post.Text = CreateHtmlAnchor(textFromApi, entities, quotedStatusLink);
             post.TextFromApi = textFromApi;
             post.TextFromApi = this.ReplaceTextFromApi(post.TextFromApi, entities, quotedStatusLink);