private static void SendCommentUpdates(Comment c, Bookmark b) { if (c == null || b == null) { return; } var url = ModifyBookmarkUrl(b); var tags = new[] { new TagValue(BookmarkSubscriptionConstants.BookmarkTitle, b.Name), new TagValue(BookmarkSubscriptionConstants.BookmarkUrl, url), new TagValue(BookmarkSubscriptionConstants.UserURL, BookmarkingBusinessUtil.RenderProfileLink(c.UserID)), new TagValue(BookmarkSubscriptionConstants.Date, c.Datetime.ToShortString()), new TagValue(BookmarkSubscriptionConstants.CommentBody, c.Content) }; var mentionedUsers = MentionProvider.GetMentionedUsers(c.Content); var mentionedUserIds = mentionedUsers.Select(u => u.ID.ToString()); var provider = BookmarkingNotifySource.Instance.GetSubscriptionProvider(); var objectID = b.ID.ToString(CultureInfo.InvariantCulture); var recipients = provider .GetRecipients(BookmarkingBusinessConstants.NotifyActionNewComment, objectID) .Where(r => !mentionedUserIds.Contains(r.ID)) .ToArray(); SendBookmarkNoticeToAsync(BookmarkingBusinessConstants.NotifyActionNewComment, objectID, recipients, tags); if (mentionedUsers.Length > 0) { SendBookmarkNoticeToAsync(BookmarkingBusinessConstants.NotifyActionMentionForBookmarkComment, objectID, mentionedUsers, tags); } }
public static void BookmarkCommentRemoved(Comment c, Bookmark b) { ASC.Web.Core.Users.Activity.UserActivityPublisher.Publish <BookmarkingUserActivityPublisher>( new BookmarkingUserActivity() { Title = b.Name, ActionType = UserActivityConstants.ActivityActionType, ContentID = c.ID.ToString(), BusinessValue = UserActivityConstants.SmallActivity, ActionText = BookmarkingBusinessResources.CommentRemovedAction, URL = BookmarkingBusinessUtil.GenerateBookmarkInfoUrl(b) }); }
public static void BookmarkAddedAsFavourite(Bookmark b) { ASC.Web.Core.Users.Activity.UserActivityPublisher.Publish <BookmarkingUserActivityPublisher>( new BookmarkingUserActivity() { Title = HttpUtility.HtmlDecode(b.Name), ActionType = UserActivityConstants.ActivityActionType, ContentID = b.ID.ToString(), BusinessValue = UserActivityConstants.NormalActivity, ActionText = BookmarkingBusinessResources.BookmarkAddedToFavouritesAction, URL = BookmarkingBusinessUtil.GenerateBookmarkInfoUrl(b) }); }
private static void SendCommentUpdates(Comment c, Bookmark b) { if (c == null || b == null) { return; } var url = ModifyBookmarkUrl(b); var tags = new[] { new TagValue(BookmarkSubscriptionConstants.BookmarkTitle, b.Name), new TagValue(BookmarkSubscriptionConstants.BookmarkUrl, url), new TagValue(BookmarkSubscriptionConstants.UserURL, BookmarkingBusinessUtil.RenderProfileLink(c.UserID)), new TagValue(BookmarkSubscriptionConstants.Date, c.Datetime.ToShortString()), new TagValue(BookmarkSubscriptionConstants.CommentBody, c.Content), GetReplyToTag(b, c) }; var objectID = b.ID.ToString(CultureInfo.InvariantCulture); var action = BookmarkingBusinessConstants.NotifyActionNewComment; SendBookmarkNoticeAsync(action, objectID, tags); }