Ticket #2495: 2495.diff
File 2495.diff, 2.2 KB (added by , 11 years ago) |
---|
-
includes/extend/buddypress/notifications.php
89 89 $component_name = 'forums'; 90 90 $component_action = 'bbp_new_reply'; 91 91 92 $args = array( 93 'user_id' => $topic_author_id, 94 'item_id' => $item_id, 95 'component_name' => $component_name, 96 'component_action' => $component_action, 97 'date_notified' => $date_notified, 98 ); 99 92 100 // Notify the topic author if not the current reply author 93 101 if ( $author_id !== $topic_author_id ) { 94 bp_core_add_notification( $item_id, $topic_author_id, $component_name, $component_action, $secondary_item_id, $date_notified ); 102 $args['secondary_item_id'] = $secondary_item_id ; 103 104 bp_notifications_add_notification( $args ); 95 105 } 96 106 97 107 // Notify the immediate reply author if not the current reply author 98 108 if ( !empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) { 99 bp_core_add_notification( $item_id, $topic_author_id, $component_name, $component_action, $reply_to_item_id, $date_notified ); 109 $args['secondary_item_id'] = $reply_to_item_id ; 110 111 bp_notifications_add_notification( $args ); 100 112 } 101 113 } 102 114 add_action( 'bbp_new_reply', 'bbp_buddypress_add_notification', 10, 7 ); … … 137 149 if ( ! bbp_has_errors() ) { 138 150 139 151 // Attempt to clear notifications for the current user from this topic 140 $success = bp_ core_mark_notifications_by_item_id( $user_id, $topic_id, 'forums', 'bbp_new_reply' );152 $success = bp_notifications_mark_notifications_by_item_id( $user_id, $topic_id, 'forums', 'bbp_new_reply' ); 141 153 142 154 // Do additional subscriptions actions 143 155 do_action( 'bbp_notifications_handler', $success, $user_id, $topic_id, $action ); -
includes/extend/buddypress/loader.php
46 46 $this->setup_globals(); 47 47 $this->setup_actions(); 48 48 $this->fully_loaded(); 49 50 buddypress()->active_components[$this->id] = '1'; 49 51 } 50 52 51 53 /**