<#if chatMessageList?? && chatMessageList.content>
<#list chatMessageList.content?reverse as chatMessage>
	<#if chatMessage.userid?? && chatMessage.userid == user.id>
		<div class="clearfix chat-block">
			<div class="chat-right">
				<img class="user-img" src="/im/img/user.png" alt="">
				<div class="chat-message">
					<label class="time">${chatMessage.createtime!''}</label>
					<label class="user">${user.uname!''}</label>
				</div>
				<div class="chatting-right">
					<i class="arrow"></i>
					<div class="chat-content">
						<#if chatMessage.msgtype?? && chatMessage.msgtype == "image">
							<a href="${(chatMessage.message!'')?no_esc}&original=true" target="_blank"><img src="${(chatMessage.message!'')?no_esc}" class="ukefu-media-image"></a>
						<#elseif chatMessage.msgtype?? && chatMessage.msgtype == "file">
							<div class="ukefu-message-file">
								<div class="ukefu-file-icon">
									<img src="/im/img/file.png">
								</div>
								<div class="ukefu-file-desc">
									<a href="${chatMessage.message!''}" target="_blank">
										<div>${chatMessage.filename!''}</div>
										<div>${(chatMessage.filesize/1024!0)?string("###,###.###")}Kb</div>
									</a>
								</div>
							</div>
						<#else>
							${(chatMessage.message!'')?no_esc}
						</#if>
					</div>
				</div>
			</div>
		</div>
	<#else>
		<div class="clearfix chat-block">
			<div class="chat-left">
				<img class="user-img" src="/im/img/user.png" alt="">
				<div class="chat-message">
					<label class="user">${chatMessage.username!''}</label>
					<label class="time">${chatMessage.createtime!''}</label>
				</div>
				<div class="chatting-left">
					<i class="arrow"></i>
					<div class="chat-content">
						<#if chatMessage.msgtype?? && chatMessage.msgtype == "image">
							<a href="${(chatMessage.message!'')?no_esc}&original=true" target="_blank"><img src="${(chatMessage.message!'')?no_esc}" class="ukefu-media-image"></a>
						<#elseif chatMessage.msgtype?? && chatMessage.msgtype == "file">
							<div class="ukefu-message-file">
								<div class="ukefu-file-icon">
									<img src="/im/img/file.png">
								</div>
								<div class="ukefu-file-desc">
									<a href="${chatMessage.message!''}" target="_blank">
										<div>${chatMessage.filename!''}</div>
										<div>${(chatMessage.filesize/1024!0)?string("###,###.###")}Kb</div>
									</a>
								</div>
							</div>
						<#else>
							${(chatMessage.message!'')?no_esc}
						</#if>
					</div>
				</div>
			</div>
		</div>
	</#if>
</#list>
</#if>