OSDN Git Service

Merge branch 'ProfileURL'
authorKimura Youichi <kim.upsilon@bucyou.net>
Mon, 19 Oct 2015 13:43:45 +0000 (22:43 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Mon, 19 Oct 2015 13:43:58 +0000 (22:43 +0900)
チケット #35627: プロフィール画面のURLがt.co形式だったのを展開したものに変更
https://osdn.jp/ticket/browse.php?group_id=6526&tid=35627

OpenTween/Resources/ChangeLog.txt
OpenTween/UserInfoDialog.cs

index db058ef..e97ce99 100644 (file)
@@ -2,9 +2,10 @@
 
 ==== Ver 1.3.0-dev(2015/xx/xx)
  * NEW: スクリーンリーダーでのタブ名の読み上げに対応しました (NVDAで動作確認)
- * CHG: Retweetイベントのイベント一覧での表示を他のイベントと統一 (thx @naminodarie)
+ * CHG: Retweetイベントのイベント一覧での表示を他のイベントと統一 (thx @naminodarie!)
  * CHG: スペースキーで未読ツイートに移動する順序を、発言一覧を日付順以外で並び替えた状態であっても表示順に移動するように修正
   - OpenTween v1.2.4 以前と同じ動作になりました
+ * CHG: プロフィール画面の「Web」「自己紹介」のURLを展開して表示するように変更 (thx @naminodarie!)
  * FIX: Home/Endキーの直後に左右キーを押すと以前の選択ツイートの関連発言に移動してしまう不具合を修正 (thx @coookien!)
  * FIX: 発言詳細部のコンテキストメニューからURLのコピーを実行すると「&」が「&amp;」としてコピーされる不具合を修正 (thx @pO_0q!)
  * FIX: タイムラインの流速が速い時に発言一覧のスクロールバーがちらつく現象を修正
index 928f4c8..0f374d6 100644 (file)
@@ -143,15 +143,15 @@ namespace OpenTween
 
             await Task.WhenAll(new[]
             {
-                this.SetDescriptionAsync(user.Description, cancellationToken),
+                this.SetDescriptionAsync(user.Description, user.Entities.Description, cancellationToken),
                 this.SetRecentStatusAsync(user.Status, cancellationToken),
-                this.SetLinkLabelWebAsync(user.Url, cancellationToken),
+                this.SetLinkLabelWebAsync(user.Url, user.Entities.Url, cancellationToken),
                 this.SetUserImageAsync(user.ProfileImageUrlHttps, cancellationToken),
                 this.LoadFriendshipAsync(user.ScreenName, cancellationToken),
             });
         }
 
-        private async Task SetDescriptionAsync(string descriptionText, CancellationToken cancellationToken)
+        private async Task SetDescriptionAsync(string descriptionText, TwitterEntities entities, CancellationToken cancellationToken)
         {
             if (descriptionText != null)
             {
@@ -161,7 +161,7 @@ namespace OpenTween
                 var decodedText = descriptionText.Replace("&lt;", "<").Replace("&gt;", ">").Replace("&quot;", "\"");
 
                 var html = WebUtility.HtmlEncode(decodedText);
-                html = await this.twitter.CreateHtmlAnchorAsync(html, atlist, null);
+                html = await this.twitter.CreateHtmlAnchorAsync(html, atlist, entities, null);
                 html = this.mainForm.createDetailHtml(html);
 
                 if (cancellationToken.IsCancellationRequested)
@@ -206,9 +206,20 @@ namespace OpenTween
             });
         }
 
-        private async Task SetLinkLabelWebAsync(string uri, CancellationToken cancellationToken)
+        private async Task SetLinkLabelWebAsync(string uri, TwitterEntities entities, CancellationToken cancellationToken)
         {
-            if (uri != null)
+            if (entities != null)
+            {
+                var expandedUrl = await ShortUrl.Instance.ExpandUrlAsync(entities.Urls[0].ExpandedUrl);
+
+                if (cancellationToken.IsCancellationRequested)
+                    return;
+
+                this.LinkLabelWeb.Text = expandedUrl;
+                this.LinkLabelWeb.Tag = expandedUrl;
+                this.ToolTip1.SetToolTip(this.LinkLabelWeb, expandedUrl);
+            }
+            else if (uri != null)
             {
                 var expandedUrl = await ShortUrl.Instance.ExpandUrlAsync(uri);