OSDN Git Service

GetListStatusとGetListStatusAdditionalを統合
authorsyo68k <syo68k@users.sourceforge.jp>
Sat, 9 Oct 2010 13:10:20 +0000 (13:10 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:15:51 +0000 (23:15 +0900)
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@952 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/Tween.vb
Tween/Twitter.vb

index d1b4f12..e1f5657 100644 (file)
@@ -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
index 0faa7b1..0653f69 100644 (file)
@@ -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