// 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;
if (TabInformations.GetInstance().IsMuted(post, isHomeTimeline: false))
return;
- base.AddPostQueue(post);
+ this.internalPosts.TryAdd(post.StatusId, post);
- if (!this.internalPosts.TryAdd(post.StatusId, post))
- return;
+ base.AddPostQueue(post);
}
public override void EnqueueRemovePost(long statusId, bool setIsDeleted)
if (setIsDeleted)
{
- PostClass post;
- if (this.internalPosts.TryGetValue(statusId, out post))
+ if (this.internalPosts.TryGetValue(statusId, out var post))
post.IsDeleted = true;
}
}
if (!base.RemovePostImmediately(statusId))
return false;
- PostClass removedPost;
- this.internalPosts.TryRemove(statusId, out removedPost);
+ this.internalPosts.TryRemove(statusId, out _);
return true;
}
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);
+ }
}
}