Exemplo n.º 1
0
 private void NotifyCategoryAdded(string category, string page)
 {
     WikiNotifyClient.SendNoticeAsync(
         SecurityContext.CurrentAccount.ID.ToString(),
         Constants.AddPageToCat,
         category,
         null,
         GetCategoryNotifyTags(category, page));
 }
Exemplo n.º 2
0
 private void NotifyCommentCreated(Page page, Comment comment)
 {
     WikiNotifyClient.SendNoticeAsync(
         SecurityContext.CurrentAccount.ID.ToString(),
         Constants.EditPage,
         PageNameUtil.ReplaceSpaces(page.PageName),
         null,
         GetNotifyTags(page.PageName, "new wiki page comment", comment));
 }
Exemplo n.º 3
0
 private void NotifyPageEdited(Page page)
 {
     WikiNotifyClient.SendNoticeAsync(
         SecurityContext.CurrentAccount.ID.ToString(),
         Constants.EditPage,
         PageNameUtil.ReplaceSpaces(page.PageName),
         null,
         GetNotifyTags(page.PageName, "edit wiki page", null));
 }
Exemplo n.º 4
0
 private void NotifyPageCreated(Page page)
 {
     WikiNotifyClient.SendNoticeAsync(
         SecurityContext.CurrentAccount.ID.ToString(),
         Constants.NewPage,
         null,
         null,
         GetNotifyTags(page.PageName));
 }
Exemplo n.º 5
0
 private void NotifyCommentCreated(Page page, Comment comment)
 {
     WikiNotifyClient.SendNoticeAsync(
         SecurityContext.CurrentAccount.ID.ToString(),
         Constants.EditPage,
         PageNameUtil.Encode(page.PageName),
         null,
         GetNotifyTags(page.PageName, "new wiki page comment", comment));
     WikiActivityPublisher.AddPageComment(page, comment);
 }
Exemplo n.º 6
0
 private void NotifyPageEdited(Page page)
 {
     WikiNotifyClient.SendNoticeAsync(
         SecurityContext.CurrentAccount.ID.ToString(),
         Constants.EditPage,
         PageNameUtil.Encode(page.PageName),
         null,
         GetNotifyTags(page.PageName, "edit wiki page", null));
     WikiActivityPublisher.EditPage(page);
 }
Exemplo n.º 7
0
        private void NotifyCommentCreated(Page page, Comment comment)
        {
            var mentionedUsers   = MentionProvider.GetMentionedUsers(comment.Body);
            var mentionedUserIds = mentionedUsers.Select(u => u.ID.ToString());

            var provider = WikiNotifySource.Instance.GetSubscriptionProvider();

            var authorID = SecurityContext.CurrentAccount.ID.ToString();
            var objectID = PageNameUtil.ReplaceSpaces(page.PageName);

            var recipients = provider
                             .GetRecipients(Constants.EditPage, objectID)
                             .Where(r => !mentionedUserIds.Contains(r.ID))
                             .ToArray();

            var tags = GetNotifyTags(page.PageName, "new wiki page comment", comment);

            WikiNotifyClient.SendNoticeToAsync(authorID, Constants.EditPage, objectID, recipients, tags);

            if (mentionedUsers.Length > 0)
            {
                WikiNotifyClient.SendNoticeToAsync(authorID, Constants.MentionForWikiComment, objectID, mentionedUsers, tags);
            }
        }