示例#1
0
        public void Handle(VoteForCommentCasted @event)
        {
            var comment = _commentService.GetCommentById(@event.CommentId);

            if (comment == null)
            {
                return;
            }

            var difference = ConvertVoteTypeToInteger(@event.VoteType) - ConvertVoteTypeToInteger(@event.PreviousVote);

            if (difference == 0)
            {
                return;
            }

            _karmaService.AdjustKarma(comment.AuthorUserId, comment.SubId, KarmaType.Comment, difference);
        }
示例#2
0
 public void Handle(VoteForCommentCasted @event)
 {
     // update for sort values for this comment
     UpdateSortsForComment(@event.CommentId);
 }