Beispiel #1
0
        private Comment ChatToComment(NMSG_Chat rawComment)
        {
            var comment = new Comment()
            {
                CommentText        = rawComment.Content,
                CommentId          = (uint)rawComment.No,
                VideoPosition      = Math.Max(rawComment.Vpos, 0),
                UserId             = rawComment.UserId,
                Mail               = rawComment.Mail,
                NGScore            = rawComment.Score ?? 0,
                IsAnonimity        = rawComment.Anonymity != 0,
                IsLoginUserComment = NiconicoSession.IsLoggedIn && rawComment.UserId == NiconicoSession.UserIdString,
                IsOwnerComment     = rawComment.UserId != null && rawComment.UserId == VideoOwnerId,
                DeletedFlag        = rawComment.Deleted ?? 0
            };

            if (!string.IsNullOrEmpty(comment.Mail))
            {
                var commandActions = DefaultCommandNicoScript.MakeCommandActions(comment.Mail.Split(' '));
                foreach (var action in commandActions)
                {
                    action(comment);
                }
            }

            return(comment);
        }
Beispiel #2
0
        private Comment ChatToComment(Chat rawComment)
        {
            var comment = new Comment()
            {
                CommentText        = rawComment.Text,
                CommentId          = rawComment.GetCommentNo(),
                VideoPosition      = Math.Max(rawComment.GetVpos(), 0),
                UserId             = rawComment.UserId,
                Mail               = rawComment.Mail,
                NGScore            = 0,
                IsAnonimity        = rawComment.GetAnonymity(),
                IsLoginUserComment = NiconicoSession.IsLoggedIn && rawComment.UserId == NiconicoSession.UserIdString,
                IsOwnerComment     = rawComment.UserId != null && rawComment.UserId == VideoOwnerId,
            };

            if (!string.IsNullOrEmpty(comment.Mail))
            {
                var commandActions = DefaultCommandNicoScript.MakeCommandActions(comment.Mail.Split(' '));
                foreach (var action in commandActions)
                {
                    action(comment);
                }
            }

            return(comment);
        }