public void SaveComment(Comment comment, Post post) { CommunitySecurity.DemandPermissions(post, ASC.Blogs.Core.Constants.Action_AddComment); SaveComment(comment); var initiatorInterceptor = new InitiatorInterceptor(new DirectRecipient(comment.UserID.ToString(), "")); try { NotifyClient.BeginSingleRecipientEvent("asc_blog_c"); NotifyClient.AddInterceptor(initiatorInterceptor); List <ITagValue> tags = new List <ITagValue> { new TagValue(ASC.Blogs.Core.Constants.TagPostSubject, post.Title), new TagValue(ASC.Blogs.Core.Constants.TagPostPreview, post.GetPreviewText(500)), new TagValue(ASC.Blogs.Core.Constants.TagUserName, DisplayUserSettings.GetFullUserName(comment.UserID)), new TagValue(ASC.Blogs.Core.Constants.TagUserURL, CommonLinkUtility.GetFullAbsolutePath(CommonLinkUtility.GetUserProfile(comment.UserID, CommonLinkUtility.GetProductID()))), new TagValue(ASC.Blogs.Core.Constants.TagDate, string.Format("{0:d} {0:t}", comment.Datetime)), new TagValue(ASC.Blogs.Core.Constants.TagCommentBody, comment.Content), new TagValue(ASC.Blogs.Core.Constants.TagURL, CommonLinkUtility.GetFullAbsolutePath(ASC.Blogs.Core.Constants.ViewBlogPageUrl + "?blogID=" + post.ID.ToString())), new TagValue(ASC.Blogs.Core.Constants.TagCommentURL, CommonLinkUtility.GetFullAbsolutePath(ASC.Blogs.Core.Constants.ViewBlogPageUrl + "?blogID=" + post.ID.ToString() + "#" + comment.ID.ToString())), GetReplyToTag(comment.ID, post) }; NotifyClient.SendNoticeAsync( ASC.Blogs.Core.Constants.NewComment, post.ID.ToString(), null, tags.ToArray()); NotifyClient.EndSingleRecipientEvent("asc_blog_c"); } finally { NotifyClient.RemoveInterceptor(initiatorInterceptor.Name); } BlogUserActivityPublisher.AddComment(comment, post); ASC.Notify.Model.ISubscriptionProvider subscriptionProvider = NotifySource.GetSubscriptionProvider(); if (!subscriptionProvider.IsUnsubscribe((IDirectRecipient)NotifySource.GetRecipientsProvider(). GetRecipient(SecurityContext.CurrentAccount.ID.ToString()), ASC.Blogs.Core.Constants.NewComment, post.ID.ToString())) { subscriptionProvider.Subscribe( ASC.Blogs.Core.Constants.NewComment, post.ID.ToString(), NotifySource.GetRecipientsProvider(). GetRecipient(SecurityContext.CurrentAccount.ID.ToString()) ); } }