<div class="message-wrapper <?php echo $is_sender ? 'sent' : 'received'; echo ! $row->content && ! $row->attached ? ' only-images' : ''; ?>" data-pm-id="<?php echo $row->id; ?>" data-uid="<?php echo $user2; ?>">

	<?php if ( ! $is_sender ) { ?>

		<div aria-hidden="true" class="message-box-logo-area" data-inverted="" data-tooltip="<?php echo wpj_get_user_display_type( $user1 ) . ' - ' . $message_date; ?>" data-position="<?php echo $i == 1 ? 'bottom' : 'top'; ?> left">

			<a class="left" tabindex="-1" href="<?php echo wpj_get_user_profile_link( $user1 ); ?>">

				<div class="message-box-logo-container">

					<?php wpj_display_user_photo( array( 'uid' => $user1, 'width' => 28, 'height' => 28, 'with_level_image' => false, 'with_link' => false ) ); ?>

				</div>

			</a>

			<div class="message-box-user-status <?php echo $status_class; ?>"></div>

		</div>

	<?php } ?>

	<div class="message-text-content<?php if ( $row->custom_offer == -1 || $row->custom_offer > 0 ) { echo ' custom-offer'; } ?>"<?php if ( $is_sender && $message_date ) { echo ' data-inverted="" data-tooltip="' . $message_date . '" data-position="' . ( $i == 1 ? 'bottom' : 'top' ) . ' right"'; } ?>>

		<div class="<?php echo $is_sender ? 'message-send' : 'message-received'; ?>">

			<!-- Custom offer -->
			<?php if ( $row->custom_offer == -1 || $row->custom_offer > 0 ) { ?>

				<div class="message-custom-offer">

					<div class="message-custom-offer-icon">

						<img src="<?php echo get_template_directory_uri() . '/assets/images/misc/custom-offer.svg'; ?>" alt="Custom Offer" class="icon" width="30" height="30">

					</div>

					<?php echo wpj_chat_get_custom_offer_info( $row );

					if ( wpj_chat_get_custom_offer_response( $row ) ) { ?>

						<span class="ui mini right label custom-offer-response <?php echo wpj_chat_get_custom_offer_response_status( $row ); ?>">

							<?php echo wpj_chat_get_custom_offer_response( $row ); ?>

						</span>

					<?php } ?>

				</div>

			<?php } else {

				// Message content
				echo wpj_make_links_clickable( $message );

				// Attachments
				if ( wpj_post_has_attachments ( $row->attached ) )
					wpj_display_attachments_list( $row->attached, '', '', '', '', true, false );

				// Image Attachments
				if ( wpj_post_has_attachments ( $row->more_details ) )
					wpj_display_attachments_list( $row->more_details, '', 'image_attachments', false, '', true, false );

			} ?>

		</div>

	</div>

</div>