{"comment":{"created_at":"2011-10-10T12:36:56Z","body":"I personally would rather see some hooks to allow you to veto the notification process or add to it.\r\nI want to avoid the situation where a plugin, in order to extend the functionality of notifications, would send 2 notifications for the same comment to a user.  \r\n\r\nHaving the code in a well defined callable area as well seems fine for your use case, but please don't design it so that it's expected people use that mechanism to fire off their own notifications.\r\n\r\nIt would be nice if there were a hook to override that would allow plugins to contribute mentions to a list that is de-duped at the end.","updated_at":"2011-10-10T12:36:56Z","url":"https://api.github.com/repos/vanillaforums/Garden/issues/comments/2346878","id":2346878,"user":{"avatar_url":"https://secure.gravatar.com/avatar/ef66373980e2ab0212846be9331fefe1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/ddumont","id":482734,"login":"ddumont"}},"action":"created","issue":{"number":1148,"created_at":"2011-10-05T18:43:03Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I can write a pull request for this myself, but I wanted to get some feedback before I tried anything.\r\n\r\nI developed code for a post-approval plugin, it works pretty nicely but the problem is it requires several additions to the core code to make it work. The most significant of which is that I need to prevent new comments and discussions from sending notifications (e.g. mentions, bookmarks, etc.), so for comments I have to add some code to CommentModel::Save2() to, basically, prevent it from executing, and in DiscussionModel::Save() I have to prevent a block of code from executing as well (the one that sends notifications).\r\n\r\nOf course, this causes another problem in that later, when the post is approved, I have to send those notifications, so what I end up having to do is take the core code and drop it into the plugin (with some modifications). This works alright but makes upgrading a pain, as I have to add my custom statements back into the core code AND update all the code I pulled out, just in case anything has changed.\r\n\r\nSo I was thinking that it would be nice if the code for notifications for discussions and comments were separated out into their own functions AND if arguments were added to those notification functions that would allow me to specify a UserID manually (if none is specified, it would default to using Gdn::Session()->UserID). That way, the notifications would be easier to disable via a plugin, AND they could be called on their own from the plugin with some parameters manually specified so I wouldn't have to copy & paste the code out myself. You'll notice the first part is already done for comments, all notifications are handled in Save2, so it would be nice if we could do the same for discussions, and then modify both functions to make it possible to call them from a plugin with some extra arguments.\r\n\r\nWhat do you guys think?","comments":2,"title":"[Request] Separate out new comment/discussion notification functions","updated_at":"2011-10-10T12:36:56Z","url":"https://api.github.com/repos/vanillaforums/Garden/issues/1148","id":1826683,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/17b6a3e8e9f3fc64e4f621a835a90384?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jspautsch","id":1054163,"login":"jspautsch"},"html_url":"https://github.com/vanillaforums/Garden/issues/1148","labels":[],"state":"open"},"legacy":{"issue_id":1826683,"comment_id":2346878}}