Changeset 11974
- Timestamp:
- 07/18/2022 08:08:41 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-profiles/profiles.php
r11971 r11974 49 49 $new_translation->translation_set_id 50 50 ); 51 52 $activities = array(); 53 $review_status = gp_post( 'status' ); 54 $valid_review_statuses = array( 'current', 'rejected', 'fuzzy' ); 55 $is_reviewing = $current_user_is_editor && get_current_user_id() !== $new_translation->user_id && 56 $review_status && in_array( $review_status, $valid_review_statuses, true ); 51 57 52 58 /* … … 58 64 */ 59 65 if ( 'waiting' === $new_translation->status && ! $current_user_is_editor ) { 60 $type = 'glotpress_translation_suggested'; 66 $activities[] = array( 67 'component' => 'glotpress', 68 'type' => 'glotpress_translation_suggested', 69 'user_id' => $new_translation->user_id, 70 ); 61 71 62 72 // Editor is approving a suggested string. 63 73 // Avoid sending a notification when a `current` post is re-saved, like when dismissing warnings. 64 74 } elseif ( 'current' === $new_translation->status && isset( $previous_translation->status ) && 'current' !== $previous_translation->status ) { 65 $type = 'glotpress_translation_approved'; 66 67 } else { 75 $activities[] = array( 76 'component' => 'glotpress', 77 'type' => 'glotpress_translation_approved', 78 'user_id' => $new_translation->user_id, 79 ); 80 } 81 82 if ( $is_reviewing ) { 83 $activities[] = array( 84 'component' => 'glotpress', 85 'type' => 'glotpress_translation_reviewed', 86 'user_id' => get_current_user_id(), 87 ); 88 } 89 90 if ( empty( $activities ) ) { 68 91 return; 69 92 } … … 72 95 'action' => 'wporg_handle_activity', 73 96 'component' => 'glotpress', 74 'type' => $type, 75 'user_id' => $new_translation->user_id, 97 'activities' => $activities, 76 98 ); 77 99
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)