diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index a5f32fd..c18be49 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -3,8 +3,8 @@ from AccessControl import getSecurityManager from AccessControl import Unauthorized from Acquisition import aq_inner from Acquisition import aq_parent -from plone.app.discussion.events import NotifyOnPublish -from plone.app.discussion.events import NotifyOnDelete +from plone.app.discussion.events import CommentPublishedEvent +from plone.app.discussion.events import CommentDeletedEvent from plone.app.discussion.interfaces import _ from plone.app.discussion.interfaces import IComment from plone.app.discussion.interfaces import IReplies @@ -103,7 +103,7 @@ class DeleteComment(BrowserView): if self.can_delete(comment): del conversation[comment.id] content_object.reindexObject() - notify(NotifyOnDelete(self.context, comment)) + notify(CommentDeletedEvent(self.context, comment)) IStatusMessage(self.context.REQUEST).addStatusMessage( _('Comment deleted.'), type='info') @@ -187,7 +187,7 @@ class PublishComment(BrowserView): workflowTool.doActionFor(comment, workflow_action) comment.reindexObject() content_object.reindexObject(idxs=['total_comments']) - notify(NotifyOnPublish(self.context, comment)) + notify(CommentPublishedEvent(self.context, comment)) IStatusMessage(self.context.REQUEST).addStatusMessage( _('Comment approved.'), type='info') @@ -263,7 +263,7 @@ class BulkActionsView(BrowserView): workflowTool.doActionFor(comment, 'publish') comment.reindexObject() content_object.reindexObject(idxs=['total_comments']) - notify(NotifyOnPublish(content_object, comment)) + notify(CommentPublishedEvent(content_object, comment)) def mark_as_spam(self): raise NotImplementedError @@ -283,4 +283,4 @@ class BulkActionsView(BrowserView): content_object = aq_parent(conversation) del conversation[comment.id] content_object.reindexObject(idxs=['total_comments']) - notify(NotifyOnDelete(content_object, comment)) + notify(CommentDeletedEvent(content_object, comment)) diff --git a/plone/app/discussion/contentrules.zcml b/plone/app/discussion/contentrules.zcml index a98d47c..8216946 100644 --- a/plone/app/discussion/contentrules.zcml +++ b/plone/app/discussion/contentrules.zcml @@ -30,13 +30,13 @@ /> @@ -68,12 +68,12 @@ /> diff --git a/plone/app/discussion/events.py b/plone/app/discussion/events.py index a38889c..61d50c4 100644 --- a/plone/app/discussion/events.py +++ b/plone/app/discussion/events.py @@ -4,8 +4,8 @@ from plone.app.discussion.interfaces import ICommentAddedEvent from plone.app.discussion.interfaces import ICommentRemovedEvent from plone.app.discussion.interfaces import IDiscussionEvent -from plone.app.discussion.interfaces import INotifyOnDelete -from plone.app.discussion.interfaces import INotifyOnPublish +from plone.app.discussion.interfaces import ICommentDeletedEvent +from plone.app.discussion.interfaces import ICommentPublishedEvent from plone.app.discussion.interfaces import IReplyAddedEvent from plone.app.discussion.interfaces import IReplyRemovedEvent from zope.interface import implementer @@ -52,13 +52,13 @@ class ReplyRemovedEvent(DiscussionEvent): """ -@implementer(INotifyOnDelete) -class NotifyOnDelete(DiscussionEvent): +@implementer(ICommentDeletedEvent) +class CommentDeletedEvent(DiscussionEvent): """ Event to be triggered when a Comment is deleted """ -@implementer(INotifyOnPublish) -class NotifyOnPublish(DiscussionEvent): +@implementer(ICommentPublishedEvent) +class CommentPublishedEvent(DiscussionEvent): """ Event to be triggered when a Comment is publicated """ diff --git a/plone/app/discussion/interfaces.py b/plone/app/discussion/interfaces.py index 10e5f78..c7f343e 100644 --- a/plone/app/discussion/interfaces.py +++ b/plone/app/discussion/interfaces.py @@ -414,11 +414,11 @@ class IReplyRemovedEvent(IDiscussionEvent): """ -class INotifyOnPublish(IDiscussionEvent): +class ICommentPublishedEvent(IDiscussionEvent): """ Notify user on comment publication """ -class INotifyOnDelete(IDiscussionEvent): +class ICommentDeletedEvent(IDiscussionEvent): """ Notify user on comment delete """