public CommentViewModel(CommentsViewModel context, Comment comment, string linkId, int depth = 0) { _context = context; _isMinimized = false; _comment = comment; _linkId = linkId; Depth = depth; AuthorFlair = SnooStreamViewModel.RedditService.GetUsernameModifiers(_comment.Author, _linkId, _comment.Subreddit); AuthorFlairText = HttpUtility.HtmlDecode(_comment.AuthorFlairText); Body = HttpUtility.HtmlDecode(_comment.Body); }
private CommentShell MakeCommentShell(Comment comment, int depth, CommentShell priorSibling) { var result = new CommentShell { Comment = new CommentViewModel(this, comment, comment.LinkId, depth), Id = comment.Id, Parent = comment.ParentId.StartsWith("t1_") ? comment.ParentId.Substring("t1_".Length) : null, PriorSibling = priorSibling != null ? priorSibling.Id : null, InsertionWaveIndex = _commentOriginStack.Count - 1, OriginType = _commentOriginStack.Last() }; return result; }
private void MergeComment(CommentShell priorSibling, Comment thingData) { priorSibling.OriginType = CommentOriginType.Edited; priorSibling.InsertionWaveIndex = _commentOriginStack.Count - 1; priorSibling.Comment.Thing = thingData; }