Changeset 4242
- Timestamp:
- 04/22/2011 09:33:48 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-messages/bp-messages-classes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-classes.php
r4211 r4242 303 303 return false; 304 304 305 $recipient_ids = array(); 306 305 307 if ( $new_thread ) { 306 308 // Add an recipient entry for all recipients 307 foreach ( (array)$this->recipients as $recipient ) 309 foreach ( (array)$this->recipients as $recipient ) { 308 310 $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient->user_id, $this->thread_id ) ); 311 $recipient_ids[] = $recipient->user_id; 312 } 309 313 310 314 // Add a sender recipient entry if the sender is not in the list of recipients 311 if ( !in_array( $this->sender_id, $ this->recipients ) )315 if ( !in_array( $this->sender_id, $recipient_ids ) ) 312 316 $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, sender_only ) VALUES ( %d, %d, 1 )", $this->sender_id, $this->thread_id ) ); 313 317 } else {
Note: See TracChangeset
for help on using the changeset viewer.