Changeset 14848
- Timestamp:
- 04/28/2026 06:50:25 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/dotorg/slack/subgroup.php
r14847 r14848 969 969 970 970 /* 971 * Channels ending in -team are private workspaces for a (often public) base 972 * channel — `#wcus-team` for `#wcus`. Subgroups should follow the base 973 * channel's name (`wcus-foo`), not the team's (`wcus-team-foo`), so users in 974 * the public base channel discover them naturally. Notifications still go to 975 * the channel where /subgroup was invoked. 971 * Channels ending in -team or -planning are private workspaces for a (often 972 * public) base channel — `#wcus-team` or `#wcus-planning` for `#wcus`. 973 * Subgroups should follow the base channel's name (`wcus-foo`), not the 974 * workspace's (`wcus-team-foo`), so users in the public base channel discover 975 * them naturally. Notifications still go to the channel where /subgroup was 976 * invoked. 976 977 */ 977 978 function derive_prefix_name( $channel_name ) { 978 if ( substr( $channel_name, -5 ) === '-team' ) { 979 return substr( $channel_name, 0, -5 ); 979 foreach ( [ '-team', '-planning' ] as $suffix ) { 980 if ( str_ends_with( $channel_name, $suffix ) ) { 981 return substr( $channel_name, 0, -strlen( $suffix ) ); 982 } 980 983 } 981 984 return $channel_name; … … 990 993 } 991 994 } 995 usort( $out, function ( $a, $b ) { 996 return strcmp( $a['name'], $b['name'] ); 997 } ); 992 998 return $out; 993 999 } … … 1139 1145 'confirm' => [ 1140 1146 'title' => [ 'type' => 'plain_text', 'text' => 'Rotate channel?' ], 1141 'text' => [ 'type' => 'mrkdwn', 'text' => "Archive <#{$g['id']}> with a year suffix and create a fresh `{$g['name']}`with only you as a member." ],1147 'text' => [ 'type' => 'mrkdwn', 'text' => "Archive `{$g['name']}` with a year suffix and create a fresh copy with only you as a member." ], 1142 1148 'confirm' => [ 'type' => 'plain_text', 'text' => 'Rotate' ], 1143 1149 'deny' => [ 'type' => 'plain_text', 'text' => 'Cancel' ], … … 1152 1158 'confirm' => [ 1153 1159 'title' => [ 'type' => 'plain_text', 'text' => 'Archive channel?' ], 1154 'text' => [ 'type' => 'mrkdwn', 'text' => "Archive <#{$g['id']}>?" ],1160 'text' => [ 'type' => 'mrkdwn', 'text' => "Archive `{$g['name']}`?" ], 1155 1161 'confirm' => [ 'type' => 'plain_text', 'text' => 'Archive' ], 1156 1162 'deny' => [ 'type' => 'plain_text', 'text' => 'Cancel' ], … … 1246 1252 'text' => [ 1247 1253 'type' => 'mrkdwn', 1248 'text' => sprintf( 'Renaming <#%s>.', $channel_id),1254 'text' => sprintf( 'Renaming `%s`.', $current_name ), 1249 1255 ], 1250 1256 ],
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)