On Monday, January 11, 2016 at 5:19:19 PM UTC-8, Dave Huang wrote: > > Hi there! In Trac 1.0.x, is there a way to send a notification to the > author of a ticket comment when someone replies to their comment? They're > not anyone who would normally get notifications from that ticket (not in Cc > list, not reporter, not owner, etc...)--just some person who saw the ticket > and commented on it. If someone replies to their comment, I'd like them to > get an email notification of the reply. > > None of the options in http://trac.edgewall.org/wiki/TracNotification > seem to do this, and I didn't spot any tickets about this specifically > (although perhaps http://trac.edgewall.org/ticket/11871 would work, in > combination with replies defaulting to including an @mention) >
You could probably implement the feature in a plugin using the new notification API that is already implemented in Trac 1.1.6. http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.INotificationSubscriber The challenging aspect will be to determine if the comment is a "replyto". That replyto information is stored in the cnum parameter. http://trac.edgewall.org/browser/tags/trac-1.1.6/trac/ticket/model.py?marks=374-376#L349 The cnum (comment number) parameter doesn't appear to be directly available in the change listener, but the following might work: * ticket['changetime'] should be equal to the timestamp of the change that triggered the change listener * convert ticket['changetime'] to a cdate * use the cdate to get the comment number via the Ticket.get_comment_number method: http://trac.edgewall.org/browser/tags/trac-1.1.6/trac/ticket/model.py#L294 * use the comment number to determine if the change was a reply-to comment * if the change was a reply-to comment, use the comment number to lookup the author of the comment replied to, and send that author a notification - Ryan -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
