public void SomeoneRepliedToComment(PhotoCommentModel mComment) { var mWhoseComment = _userService.GetUser(mComment.UserId); var mParentComment = _commentService.GetPhotoComment(mComment.Reply); var mParentCommentOwner = _userService.GetUser(mParentComment.UserId); mParentCommentOwner.Email = mParentCommentOwner.Email.ToLower(); // todo: remove and refactor, when id to cookies will be added var noty = String.Format("Пользователь <span class='highlight_from'>{0} {1}</span> " + "ответил на ваш комментарий к фотографии." , mWhoseComment.FirstName, mWhoseComment.LastName); _hubNotify.Clients.Group(mParentCommentOwner.Email) .SendNotification(NotificationTitles.CommentAdded, noty, _urlUtil.BuildCommentUrl(mComment.PhotoId, mComment.Id)); }
private IFoundViewModel GetCommentFoundViewModel(IFound found) { var commentFound = (CommentFound)found; UserModel user = _userService.GetUser(commentFound.OwnerId); string userName = user.FirstName + " " + user.LastName; return(new CommentFoundViewModel { CommentUrl = urlUtil.BuildCommentUrl(commentFound.PhotoId, commentFound.Id), DateOfCreation = commentFound.DateOfCreation, UserName = userName, Text = commentFound.Text, UserViewUrl = urlUtil.BuildUserViewUrl(commentFound.OwnerId), UserAvatarPath = pathUtil.BuildAvatarPath(commentFound.OwnerId, ImageSize.Medium) }); }