OSDN Git Service

C# 8.0 のnull許容参照型を有効化
[opentween/open-tween.git] / OpenTween / Models / InternalStorageTabModel.cs
index b1f7ff1..0e39cd5 100644 (file)
@@ -25,6 +25,8 @@
 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 // Boston, MA 02110-1301, USA.
 
+#nullable enable
+
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
@@ -71,7 +73,7 @@ namespace OpenTween.Models
             if (!base.RemovePostImmediately(statusId))
                 return false;
 
-            this.internalPosts.TryRemove(statusId, out var removedPost);
+            this.internalPosts.TryRemove(statusId, out _);
 
             return true;
         }
@@ -81,5 +83,13 @@ namespace OpenTween.Models
             base.ClearIDs();
             this.internalPosts.Clear();
         }
+
+        internal override bool SetReadState(long statusId, bool read)
+        {
+            if (this.Posts.TryGetValue(statusId, out var post))
+                post.IsRead = read;
+
+            return base.SetReadState(statusId, read);
+        }
     }
 }