Changeset 13010
- Timestamp:
- 12/05/2023 02:32:44 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/webhook.php
r12613 r13010 82 82 83 83 // Determine the WordPress.org user for this HelpScout user. 84 $stat_user = 'HS-' . get_client()->name . '-' . $hs_user_id; 84 85 $wporg_user = get_wporg_user_for_helpscout_user( $hs_user_id ); 85 86 if ( $wporg_user ) { 86 87 $stat_user = $wporg_user->user_nicename; 87 } else {88 $client = get_client();89 $stat_user = "HS-{$client->name}-{$hs_user_id}";90 88 } 89 90 // Per-mailbox stats. 91 $mailbox = get_mailbox_name( $request ); 91 92 92 93 // Total actions performed by user. 93 94 bump_stats_extra( 'hs-total', $stat_user ); 95 96 if ( $mailbox ) { 97 bump_stats_extra( 'hs-' . $mailbox . '-total', $stat_user ); 98 } 94 99 95 100 // Specific actions performed by user, replies and outgoing emails are counted as replies. … … 97 102 case 'convo.agent.reply.created': 98 103 bump_stats_extra( 'hs-replies', $stat_user ); 104 105 if ( $mailbox ) { 106 bump_stats_extra( 'hs-' . $mailbox . '-replies', $stat_user ); 107 } 99 108 break; 100 109 case 'convo.created': 101 110 if ( 'user' === $request->createdBy->type ?? '' ) { 102 111 bump_stats_extra( 'hs-replies', $stat_user ); 112 113 if ( $mailbox ) { 114 bump_stats_extra( 'hs-' . $mailbox . '-replies', $stat_user ); 115 } 103 116 } 104 117 break;
Note: See TracChangeset
for help on using the changeset viewer.