Code Duplication    Length = 18-19 lines in 2 locations

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

@@ 196-214 (lines=19) @@
193
		do_action( 'jetpack_deleted_user', $deleted_user_id, $reassigned_user_id, $is_multisite );
194
	}
195
196
	function user_register_handler( $user_id, $old_user_data = null ) {
197
		// ensure we only sync users who are members of the current blog
198
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
199
			return;
200
		}
201
202
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
203
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
204
		}
205
		/**
206
		 * Fires when a new user is registered on a site
207
		 *
208
		 * @since 4.9.0
209
		 *
210
		 * @param object The WP_User object
211
		 */
212
		do_action( 'jetpack_sync_register_user', $user_id, $this->get_flags( $user_id ) );
213
214
	}
215
216
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
217
		// ensure we only sync users who are members of the current blog
@@ 216-233 (lines=18) @@
213
214
	}
215
216
	function add_user_to_blog_handler( $user_id, $old_user_data = null ) {
217
		// ensure we only sync users who are members of the current blog
218
		if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
219
			return;
220
		}
221
222
		if ( Jetpack_Constants::is_true( 'JETPACK_INVITE_ACCEPTED' ) ) {
223
			$this->add_flags( $user_id, array( 'invitation_accepted' => true ) );
224
		}
225
		/**
226
		 * Fires when a user is added on a site
227
		 *
228
		 * @since 4.9.0
229
		 *
230
		 * @param object The WP_User object
231
		 */
232
		do_action( 'jetpack_sync_add_user', $user_id, $this->get_flags( $user_id ) );
233
	}
234
235
	function save_user_handler( $user_id, $old_user_data = null ) {
236
		// ensure we only sync users who are members of the current blog