public WhowatchCommentViewModel(Comment comment, ICommentOptions options, IWhowatchSiteOptions siteOptions, IUser user, ICommentProvider cp, bool isFirstComment)
            : base(options, user, cp, isFirstComment)
        {
            _siteOptions = siteOptions;
            _user        = user;
            Id           = comment.Id.ToString();

            var name = comment.User.Name;

            user.Name = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(name)
            };
            var message = comment.Message;

            if (siteOptions.NeedAutoSubNickname)
            {
                var nick = ExtractNickname(message);
                if (!string.IsNullOrEmpty(nick))
                {
                    user.Nickname = nick;
                }
            }
            NameItemsInternal = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(name)
            };
            MessageItems = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(message)
            };

            var iconUrl = !string.IsNullOrEmpty(comment.User.IconUrl) ? comment.User.IconUrl : DefaultUserIconUrl;

            Thumbnail = new MessageImage {
                Url = iconUrl
            };

            Init();
        }
        public WhowatchCommentViewModel(Comment comment, Dictionary <long, PlayItem> itemDict, ICommentOptions options, IWhowatchSiteOptions siteOptions, IUser user, ICommentProvider cp, bool isFirstComment)
            : base(options, user, cp, isFirstComment)
        {
            _siteOptions = siteOptions;
            _user        = user;
            if (comment.CommentType == "BY_PLAYITEM")
            {
                MessageType = MessageType.BroadcastInfo;
            }
            else
            {
                MessageType = MessageType.Comment;
            }

            if (comment.CommentType == "BY_PLAYITEM")
            {
                CommentType = CommentType.Item;
                if (itemDict.TryGetValue(comment.PlayItemPatternId.Value, out PlayItem item))
                {
                    Info = $"{item.Name}×{comment.ItemCount}";
                }
            }

            Id = comment.Id.ToString();

            var name = comment.User.Name;

            user.Name = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(name)
            };
            var message = comment.Message;

            if (siteOptions.NeedAutoSubNickname)
            {
                var nick = ExtractNickname(message);
                if (!string.IsNullOrEmpty(nick))
                {
                    user.Nickname = nick;
                }
            }
            if (user == null || string.IsNullOrEmpty(user.Nickname))
            {
                NameItemsInternal = new List <IMessagePart> {
                    MessagePartFactory.CreateMessageText(name)
                };
            }
            else
            {
                NameItemsInternal = new List <IMessagePart> {
                    MessagePartFactory.CreateMessageText(user.Nickname)
                };
            }
            MessageItems = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(message)
            };

            var iconUrl = !string.IsNullOrEmpty(comment.User.IconUrl) ? comment.User.IconUrl : DefaultUserIconUrl;

            Thumbnail = new MessageImage {
                Url = iconUrl
            };
        }