svnno****@sourc*****
svnno****@sourc*****
2011年 1月 1日 (土) 12:35:40 JST
Revision: 1301 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1301 Author: anis774 Date: 2011-01-01 12:35:40 +0900 (Sat, 01 Jan 2011) Log Message: ----------- rev1300の変更をユーザー情報ダイアログにも適用 Revision Links: -------------- http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1300 Modified Paths: -------------- trunk/Tween/ShowUserInfo.vb trunk/Tween/Tween.vb -------------- next part -------------- Modified: trunk/Tween/ShowUserInfo.vb =================================================================== --- trunk/Tween/ShowUserInfo.vb 2011-01-01 03:19:30 UTC (rev 1300) +++ trunk/Tween/ShowUserInfo.vb 2011-01-01 03:35:40 UTC (rev 1301) @@ -337,14 +337,13 @@ MyOwner.HashMgr.AddHashToHistory(hash.Trim, False) MyOwner.AddNewTabForSearch(hash) Exit Sub - ElseIf e.Url.AbsoluteUri.StartsWith("http://twitter.com/") Then - MyOwner.AddNewTabForUserTimeline(e.Url.AbsoluteUri.Remove(0, "http://twitter.com/".Length)) - Exit Sub - ElseIf e.Url.AbsoluteUri.StartsWith("https://twitter.com/") Then - MyOwner.AddNewTabForUserTimeline(e.Url.AbsoluteUri.Remove(0, "https://twitter.com/".Length)) - Exit Sub Else - MyOwner.OpenUriAsync(e.Url.OriginalString) + Dim m As Match = Regex.Match(e.Url.AbsoluteUri, "^https?://twitter.com/(#!/)?(?<name>[a-zA-Z0-9_]+)$") + If m.Success AndAlso MyOwner.IsTwitterId(m.Result("${name}")) Then + MyOwner.AddNewTabForUserTimeline(m.Result("${name}")) + Else + MyOwner.OpenUriAsync(e.Url.OriginalString) + End If End If End If End Sub Modified: trunk/Tween/Tween.vb =================================================================== --- trunk/Tween/Tween.vb 2011-01-01 03:19:30 UTC (rev 1300) +++ trunk/Tween/Tween.vb 2011-01-01 03:35:40 UTC (rev 1301) @@ -9059,7 +9059,7 @@ ' TwitterIDでない固定文字列を調べる(文字列検証のみ 実際に取得はしない) ' URLから切り出した文字列を渡す - Private Function IsTwitterId(ByVal name As String) As Boolean + Public Function IsTwitterId(ByVal name As String) As Boolean Return Not Regex.Match(name, "^(about|jobs|tos|privacy)$").Success End Function