OSDN Git Service

TweenMainクラス内で行っている各タブの更新処理をTabModelの派生クラスに移動
[opentween/open-tween.git] / OpenTween / Models / FavoritesTabModel.cs
index 900a2c8..10983eb 100644 (file)
@@ -45,5 +45,23 @@ namespace OpenTween.Models
         public FavoritesTabModel(string tabName) : base(tabName)
         {
         }
+
+        public override async Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress)
+        {
+            bool read;
+            if (!SettingCommon.Instance.UnreadManage)
+                read = true;
+            else
+                read = startup && SettingCommon.Instance.Read;
+
+            progress.Report(Properties.Resources.GetTimelineWorker_RunWorkerCompletedText19);
+
+            await tw.GetFavoritesApi(read, backward)
+                .ConfigureAwait(false);
+
+            TabInformations.GetInstance().DistributePosts();
+
+            progress.Report(Properties.Resources.GetTimelineWorker_RunWorkerCompletedText20);
+        }
     }
 }