コード例 #1
0
ファイル: CommentClient.cs プロジェクト: willvin313/Hohoema
        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);
        }
コード例 #2
0
 private VideoComment ChatToComment(NMSG_Chat rawComment)
 {
     return(new VideoComment()
     {
         CommentText = rawComment.Content,
         CommentId = rawComment.No,
         VideoPosition = rawComment.Vpos.ToTimeSpan(),
         UserId = rawComment.UserId,
         Mail = rawComment.Mail,
         NGScore = rawComment.Score ?? 0,
         IsAnonymity = rawComment.Anonymity != 0,
         IsLoginUserComment = _niconicoSession.IsLoggedIn && rawComment.Anonymity == 0 && rawComment.UserId == _niconicoSession.UserId,
         //IsOwnerComment = rawComment.UserId != null && rawComment.UserId == VideoOwnerId,
         DeletedFlag = rawComment.Deleted ?? 0
     });
 }
コード例 #3
0
ファイル: CommentClient.cs プロジェクト: kokkiemouse/Hohoema
 private Comment ChatToComment(NMSG_Chat rawComment)
 {
     return 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
     };
 }