From 93289ec5f44673cebbc7945768ddcae02e54c11f Mon Sep 17 00:00:00 2001 From: syo68k Date: Sat, 9 Oct 2010 13:10:20 +0000 Subject: [PATCH] =?utf8?q?GetListStatus=E3=81=A8GetListStatusAdditional?= =?utf8?q?=E3=82=92=E7=B5=B1=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@952 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/Tween.vb | 4 ++-- Tween/Twitter.vb | 50 +++++++++++++------------------------------------- 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/Tween/Tween.vb b/Tween/Tween.vb index d1b4f122..e1f56574 100644 --- a/Tween/Tween.vb +++ b/Tween/Tween.vb @@ -2032,7 +2032,7 @@ Public Class TweenMain If _FirstListsRefreshFlags AndAlso SettingDialog.UseAdditionalCount AndAlso Not SettingDialog.FirstCountApi = 0 Then _FirstListsRefreshFlags = False For Each tb As TabClass In _statuses.GetTabsByType(TabUsageType.Lists) - If tb.ListInfo IsNot Nothing AndAlso tb.ListInfo.Id <> 0 Then ret = tw.GetListStatusAdditional(read, tb, False, SettingDialog.FirstCountApi) + If tb.ListInfo IsNot Nothing AndAlso tb.ListInfo.Id <> 0 Then ret = tw.GetListStatus(read, tb, False, SettingDialog.FirstCountApi) Next Else For Each tb As TabClass In _statuses.GetTabsByType(TabUsageType.Lists) @@ -2044,7 +2044,7 @@ Public Class TweenMain If tb IsNot Nothing Then If _UseAdditionalFlags AndAlso Not SettingDialog.MoreCountApi = 0 Then _UseAdditionalFlags = False - ret = tw.GetListStatusAdditional(read, tb, args.page = -1, SettingDialog.MoreCountApi) + ret = tw.GetListStatus(read, tb, args.page = -1, SettingDialog.MoreCountApi) Else ret = tw.GetListStatus(read, tb, args.page = -1) End If diff --git a/Tween/Twitter.vb b/Tween/Twitter.vb index 0faa7b11..0653f69a 100644 --- a/Tween/Twitter.vb +++ b/Tween/Twitter.vb @@ -1409,45 +1409,17 @@ Public Class Twitter End If End Function - Public Function GetListStatus(ByVal read As Boolean, _ + Public Overloads Function GetListStatus(ByVal read As Boolean, _ ByVal tab As TabClass, _ ByVal more As Boolean) As String - If _endingFlag Then Return "" - - Dim res As HttpStatusCode - Dim content As String = "" - Dim page As Integer = 0 - Dim countQuery As Integer = 0 - Try - If more Then - res = twCon.GetListsStatuses(tab.ListInfo.UserId.ToString, tab.ListInfo.Id.ToString, _countApi, tab.OldestId, 0, content) - Else - res = twCon.GetListsStatuses(tab.ListInfo.UserId.ToString, tab.ListInfo.Id.ToString, _countApi, 0, 0, content) - End If - countQuery = _countApi - Catch ex As Exception - Return "Err:" + ex.Message - End Try - Select Case res - Case HttpStatusCode.OK - Twitter.AccountState = ACCOUNT_STATE.Valid - Case HttpStatusCode.Unauthorized - Twitter.AccountState = ACCOUNT_STATE.Invalid - Return "Check your Username/Password." - Case HttpStatusCode.BadRequest - Return "Err:API Limits?" - Case Else - Return "Err:" + res.ToString() + "(" + GetCurrentMethod.Name + ")" - End Select - - Return CreatePostsFromXml(content, WORKERTYPE.List, tab, read, countQuery, tab.OldestId) + Return GetListStatus(read, tab, more, -1) End Function - Public Function GetListStatusAdditional(ByVal read As Boolean, _ + Public Overloads Function GetListStatus(ByVal read As Boolean, _ ByVal tab As TabClass, _ ByVal more As Boolean, _ - ByVal addcount As Integer) As String + ByVal count As Integer) As String If _endingFlag Then Return "" @@ -1456,12 +1428,18 @@ Public Class Twitter Dim page As Integer = 0 Dim countQuery As Integer = 0 Try + Dim cnt As Integer = 0 + If count < 0 Then + cnt = _countApi + Else + cnt = count + End If If more Then - res = twCon.GetListsStatuses(tab.ListInfo.UserId.ToString, tab.ListInfo.Id.ToString, addcount, tab.OldestId, 0, content) + res = twCon.GetListsStatuses(tab.ListInfo.UserId.ToString, tab.ListInfo.Id.ToString, cnt, tab.OldestId, 0, content) Else - res = twCon.GetListsStatuses(tab.ListInfo.UserId.ToString, tab.ListInfo.Id.ToString, addcount, 0, 0, content) + res = twCon.GetListsStatuses(tab.ListInfo.UserId.ToString, tab.ListInfo.Id.ToString, cnt, 0, 0, content) End If - countQuery = addcount + countQuery = cnt Catch ex As Exception Return "Err:" + ex.Message End Try @@ -1620,8 +1598,6 @@ Public Class Twitter End Try Next - 'If _ApiMethod = MySocket.REQ_TYPE.ReqGetAPI Then _remainCountApi = sck.RemainCountApi - Return "" End Function -- 2.11.0