Code Duplication    Length = 19-20 lines in 2 locations

sync/class.jetpack-sync-module-users.php 2 locations

@@ 243-262 (lines=20) @@
240
		do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite );
241
	}
242
243
	function user_register_handler( $user_id, $old_user_data = null ) {
244
		// ensure we only sync users who are members of the current blog
245
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
246
			return;
247
		}
248
249
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
250
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
251
		}
252
		/**
253
		 * Fires when a new user is registered on a site
254
		 *
255
		 * @since 4.9.0
256
		 *
257
		 * @param object The WP_User object
258
		 */
259
		do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) );
260
		$this->clear_flags( $user_id );
261
262
	}
263
264
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
265
		// ensure we only sync users who are members of the current blog
@@ 264-282 (lines=19) @@
261
262
	}
263
264
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
265
		// ensure we only sync users who are members of the current blog
266
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
267
			return;
268
		}
269
270
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
271
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
272
		}
273
		/**
274
		 * Fires when a user is added on a site
275
		 *
276
		 * @since 4.9.0
277
		 *
278
		 * @param object The WP_User object
279
		 */
280
		do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) );
281
		$this->clear_flags( $user_id );
282
	}
283
284
	function save_user_handler( $user_id, $old_user_data = null ) {
285
		// ensure we only sync users who are members of the current blog