Code Duplication    Length = 4-4 lines in 2 locations

core/libraries/messages/EE_messages.lib.php 2 locations

@@ 427-430 (lines=4) @@
424
				//let's GET the message body from the messenger (instead of the normal send_message)
425
				return $messenger->get_preview( $message->messages[0], $message, $send );
426
427
			} else {
428
				EE_Error::add_error( sprintf( __('Messenger: %s does not exist', 'event_espresso'), $messenger ), __FILE__, __FUNCTION__, __LINE__ );
429
				return FALSE;
430
			}
431
432
		} else {
433
			EE_Error::add_error( sprintf( __('Message type: %s does not exist', 'event_espresso'), $type ), __FILE__, __FUNCTION__, __LINE__ );
@@ 558-561 (lines=4) @@
555
		if ( !$is_global ) {
556
			$has_active = EEM_Message_Template_Group::instance()->count( array( array( 'MTP_is_active' => TRUE, 'MTP_messenger' => $this->_messenger->name, 'MTP_message_type' => $message_type ) ) );
557
558
			if ( $has_active == 0 ) {
559
				EE_Error::add_error( sprintf(__(' The %s message type is not registered with the %s messenger. Please visit the Messenger activation page to assign this message type first if you want to use it.', 'event_espresso'), $message_type, $messenger), __FILE__, __FUNCTION__, __LINE__ );
560
				return false;
561
			}
562
563
		}
564
		return true;