svnno****@sourc*****
svnno****@sourc*****
2010年 12月 31日 (金) 14:47:43 JST
Revision: 1294 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1294 Author: kiri_feather Date: 2010-12-31 14:47:43 +0900 (Fri, 31 Dec 2010) Log Message: ----------- GetOldestUnreadIdをGetOldestUnreadIndexに名前変更 Modified Paths: -------------- trunk/Tween/StatusDictionary.vb trunk/Tween/Tween.vb trunk/Tween/Twitter.vb -------------- next part -------------- Modified: trunk/Tween/StatusDictionary.vb =================================================================== --- trunk/Tween/StatusDictionary.vb 2010-12-31 05:23:06 UTC (rev 1293) +++ trunk/Tween/StatusDictionary.vb 2010-12-31 05:47:43 UTC (rev 1294) @@ -686,7 +686,7 @@ End SyncLock End Sub - Public Function GetOldestUnreadId(ByVal TabName As String) As Integer + Public Function GetOldestUnreadIndex(ByVal TabName As String) As Integer Dim tb As TabClass = _tabs(TabName) If tb.OldestUnreadId > -1 AndAlso _ tb.Contains(tb.OldestUnreadId) AndAlso _ Modified: trunk/Tween/Tween.vb =================================================================== --- trunk/Tween/Tween.vb 2010-12-31 05:23:06 UTC (rev 1293) +++ trunk/Tween/Tween.vb 2010-12-31 05:47:43 UTC (rev 1294) @@ -4467,7 +4467,7 @@ '現在タブから最終タブまで探索 For i As Integer = bgnIdx To ListTab.TabPages.Count - 1 '未読Index取得 - idx = _statuses.GetOldestUnreadId(ListTab.TabPages(i).Text) + idx = _statuses.GetOldestUnreadIndex(ListTab.TabPages(i).Text) If idx > -1 Then ListTab.SelectedIndex = i lst = DirectCast(ListTab.TabPages(i).Tag, DetailsListView) @@ -4479,7 +4479,7 @@ '未読みつからず&現在タブが先頭ではなかったら、先頭タブから現在タブの手前まで探索 If idx = -1 AndAlso bgnIdx > 0 Then For i As Integer = 0 To bgnIdx - 1 - idx = _statuses.GetOldestUnreadId(ListTab.TabPages(i).Text) + idx = _statuses.GetOldestUnreadIndex(ListTab.TabPages(i).Text) If idx > -1 Then ListTab.SelectedIndex = i lst = DirectCast(ListTab.TabPages(i).Tag, DetailsListView) Modified: trunk/Tween/Twitter.vb =================================================================== --- trunk/Tween/Twitter.vb 2010-12-31 05:23:06 UTC (rev 1293) +++ trunk/Tween/Twitter.vb 2010-12-31 05:47:43 UTC (rev 1294) @@ -1732,118 +1732,6 @@ Return "" End Function - Private Function CreatePostsFromXml(ByVal content As String, ByVal gType As WORKERTYPE, ByVal tab As TabClass, ByVal read As Boolean, ByVal count As Integer, ByRef minimumId As Long) As String - Dim xdoc As New XmlDocument - Try - xdoc.LoadXml(content) - Catch ex As Exception - TraceOut(content) - 'MessageBox.Show("不正なXMLです。(TL-LoadXml)") - Return "Invalid XML!" - End Try - - For Each xentryNode As XmlNode In xdoc.DocumentElement.SelectNodes("./status") - Dim xentry As XmlElement = CType(xentryNode, XmlElement) - Dim post As New PostClass - Try - post.Id = Long.Parse(xentry.Item("id").InnerText) - If minimumId > post.Id Then minimumId = post.Id - '二重取得回避 - SyncLock LockObj - If tab Is Nothing Then - If TabInformations.GetInstance.ContainsKey(post.Id) Then Continue For - Else - If TabInformations.GetInstance.ContainsKey(post.Id, tab.TabName) Then Continue For - End If - End SyncLock - 'Retweet判定 - Dim xRnode As XmlNode = xentry.SelectSingleNode("./retweeted_status") - If xRnode IsNot Nothing Then - Dim xRentry As XmlElement = CType(xRnode, XmlElement) - post.PDate = DateTime.ParseExact(xRentry.Item("created_at").InnerText, "ddd MMM dd HH:mm:ss zzzz yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None) - 'Id - post.RetweetedId = Long.Parse(xRentry.Item("id").InnerText) - '本文 - post.Data = xRentry.Item("text").InnerText - 'Source取得(htmlの場合は、中身を取り出し) - post.Source = xRentry.Item("source").InnerText - 'Reply先 - Long.TryParse(xRentry.Item("in_reply_to_status_id").InnerText, post.InReplyToId) - post.InReplyToUser = xRentry.Item("in_reply_to_screen_name").InnerText - post.IsFav = TabInformations.GetInstance.GetTabByType(TabUsageType.Favorites).Contains(post.RetweetedId) - 'post.IsFav = Boolean.Parse(xentry.Item("favorited").InnerText) - - '以下、ユーザー情報 - Dim xRUentry As XmlElement = CType(xRentry.SelectSingleNode("./user"), XmlElement) - post.Uid = Long.Parse(xRUentry.Item("id").InnerText) - post.Name = xRUentry.Item("screen_name").InnerText - post.Nickname = xRUentry.Item("name").InnerText - post.ImageUrl = xRUentry.Item("profile_image_url").InnerText - post.IsProtect = Boolean.Parse(xRUentry.Item("protected").InnerText) - post.IsMe = post.Name.ToLower.Equals(_uid) - If post.IsMe Then _UserIdNo = post.Uid.ToString() - - 'Retweetした人 - Dim xUentry As XmlElement = CType(xentry.SelectSingleNode("./user"), XmlElement) - post.RetweetedBy = xUentry.Item("screen_name").InnerText - Else - post.PDate = DateTime.ParseExact(xentry.Item("created_at").InnerText, "ddd MMM dd HH:mm:ss zzzz yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None) - '本文 - post.Data = xentry.Item("text").InnerText - 'Source取得(htmlの場合は、中身を取り出し) - post.Source = xentry.Item("source").InnerText - Long.TryParse(xentry.Item("in_reply_to_status_id").InnerText, post.InReplyToId) - post.InReplyToUser = xentry.Item("in_reply_to_screen_name").InnerText - 'in_reply_to_user_idを使うか? - post.IsFav = Boolean.Parse(xentry.Item("favorited").InnerText) - - '以下、ユーザー情報 - Dim xUentry As XmlElement = CType(xentry.SelectSingleNode("./user"), XmlElement) - post.Uid = Long.Parse(xUentry.Item("id").InnerText) - post.Name = xUentry.Item("screen_name").InnerText - post.Nickname = xUentry.Item("name").InnerText - post.ImageUrl = xUentry.Item("profile_image_url").InnerText - post.IsProtect = Boolean.Parse(xUentry.Item("protected").InnerText) - post.IsMe = post.Name.ToLower.Equals(_uid) - If post.IsMe Then _UserIdNo = post.Uid.ToString() - End If - 'HTMLに整形 - post.OriginalData = CreateHtmlAnchor(post.Data, post.ReplyToList) - post.Data = HttpUtility.HtmlDecode(post.Data) - post.Data = post.Data.Replace("<3", "♡") - 'Source整形 - CreateSource(post) - - post.IsRead = read - If gType = WORKERTYPE.Timeline OrElse tab IsNot Nothing Then - post.IsReply = post.ReplyToList.Contains(_uid) - Else - post.IsReply = True - End If - post.IsExcludeReply = False - - If post.IsMe Then - post.IsOwl = False - Else - If followerId.Count > 0 Then post.IsOwl = Not followerId.Contains(post.Uid) - End If - If post.IsMe AndAlso Not read AndAlso _readOwnPost Then post.IsRead = True - - post.IsDm = False - If tab IsNot Nothing Then post.RelTabName = tab.TabName - Catch ex As Exception - TraceOut(content) - 'MessageBox.Show("不正なXMLです。(TL-Parse)") - Continue For - End Try - - TabInformations.GetInstance.AddPost(post) - - Next - - Return "" - End Function - Public Function GetSearch(ByVal read As Boolean, _ ByVal tab As TabClass, _ ByVal more As Boolean) As String