Here is a proposal for a simple way to support notifying on addition of comments.
We need a callback that looks like this
ad_proc -callback general_comments::notify_objects {
} {
What object_ids should have notifications triggered when
a comment is added?
@return list of object_ids to send notifications on
} -
So when a comment is added this callback is called. Implementations should be named after the object_type of the object_id that is being commented on.
General comments will then call notification::new for each of those object_ids.
In this case the text of the email is in the general comments package.
----
An alternative would be to delegate the sending of notificaitons to the callback itself. In this case:
ad_proc -callback genearl_comments::object_notifications -object_id
} {
@param object_id Object id of object receving comment
}
The implementation will still be named after the object type of the object_id that is being commented on.
In this case the text of the notification and what objects will be notified is determined in the callback. The callback is also responsible to call notification::new.
Any other ideas?