Index: openacs.org-dev/packages/notifications/tcl/sweep-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/notifications/tcl/sweep-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/notifications/tcl/sweep-procs.tcl 9 Jul 2002 17:35:10 -0000 1.1 +++ openacs.org-dev/packages/notifications/tcl/sweep-procs.tcl 12 Feb 2003 13:18:07 -0000 1.2 @@ -16,9 +16,10 @@ } ad_proc -public cleanup_notifications {} { - Clean up the notifications that are done + Clean up the notifications that have been sent out (DRB: inefficiently...). } { # Get the list of the ones to kill + set notification_id_list [db_list select_notification_ids {}] # Kill them @@ -51,14 +52,14 @@ # Batched sending foreach notif $notifications { - ns_log Notice "NOTIF-BATCHED: one notif $notif" + ns_log Debug "NOTIF-BATCHED: one notif $notif" if {$notif != "STOP"} { - ns_log Notice "NOTIF-BATCHED: NOT a stop codon" + ns_log Debug "NOTIF-BATCHED: NOT a stop codon" set user_id [ns_set get $notif user_id] set type_id [ns_set get $notif type_id] } else { - ns_log Notice "NOTIF-BATCHED stop codon!" + ns_log Debug "NOTIF-BATCHED stop codon!" set user_id "" set type_id "" } @@ -67,20 +68,20 @@ # if so, batch up previous stuff and send it if {$notif == "STOP" || $user_id != $prev_user_id || $type_id != $prev_type_id} { - ns_log Notice "NOTIF-BATCHED: batching things up for $prev_user_id" + ns_log Debug "NOTIF-BATCHED: batching things up for $prev_user_id" # If no content, keep going if {![empty_string_p $batched_content]} { - ns_log Notice "NOTIF-BATCHED: content to send!" + ns_log Debug "NOTIF-BATCHED: content to send!" db_transaction { - ns_log Notice "NOTIF-BATCHED: sending content" + ns_log Debug "NOTIF-BATCHED: sending content" notification::delivery::send -to_user_id $prev_user_id \ -notification_type_id $prev_type_id \ -subject "\[[ad_system_name] - Batched Notification\]" \ -content $batched_content \ -delivery_method_id $prev_deliv_method_id - ns_log Notice "NOTIF-BATCHED: marking notifications" + ns_log Debug "NOTIF-BATCHED: marking notifications" foreach not_id $list_of_notification_ids { # Mark it as sent notification::mark_sent \ @@ -93,7 +94,7 @@ set list_of_notification_ids [list] set batched_content "" } else { - ns_log Notice "NOTIF-BATCHED: NO content to send!" + ns_log Debug "NOTIF-BATCHED: NO content to send!" } } @@ -103,8 +104,8 @@ # append content to built-up content - ns_log Notice "NOTIF-BATCHED: appending one notif!" - append batched_content "SUBJECT: [ns_set get $notif object_name] - [ns_set get $notif notif_subject]\n[ns_set get $notif notif_text]\n=====================\n" + ns_log Debug "NOTIF-BATCHED: appending one notif!" + append batched_content "SUBJECT: [ns_set get $notif notif_subject]\n[ns_set get $notif notif_text]\n=====================\n" lappend list_of_notification_ids [ns_set get $notif notification_id] # Set the vars @@ -120,7 +121,7 @@ # Send it notification::delivery::send -to_user_id [ns_set get $notif user_id] \ -notification_type_id [ns_set get $notif type_id] \ - -subject "\[[ad_system_name] - [ns_set get $notif object_name]\] [ns_set get $notif notif_subject]" \ + -subject [ns_set get $notif notif_subject] \ -content [ns_set get $notif notif_text] \ -reply_object_id [ns_set get $notif response_id] \ -delivery_method_id [ns_set get $notif delivery_method_id]