push current stand
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="flex-1 overflow-y-auto" id="contacts-container">
|
||||
<?php foreach ($allUsers as $user): ?>
|
||||
<?php if ($user['id'] != $currentUser['id']): ?>
|
||||
<?php if ($user['id'] != $currentUserId): ?>
|
||||
<div class="contact p-2 cursor-pointer hover:bg-gray-100 flex justify-between items-center" data-userid="<?= $user['id'] ?>">
|
||||
<span><?= htmlspecialchars($user['vorname'] . ' ' . $user['nachname']) ?></span>
|
||||
<span class="badge bg-red-500 text-white rounded-full px-2 py-1 text-xs"
|
||||
@@ -37,8 +37,8 @@
|
||||
<div id="chat-window" class="flex-1 p-4 overflow-y-auto">
|
||||
<?php if(!empty($messages)): ?>
|
||||
<?php foreach($messages as $msg): ?>
|
||||
<div class="flex <?= $msg['user_sender'] == $currentUser['id'] ? 'justify-end' : 'justify-start' ?> mb-2">
|
||||
<div class="<?= $msg['user_sender'] == $currentUser['id'] ? 'bg-blue-500 text-white' : 'bg-gray-300 text-black' ?> p-2 rounded max-w-xs break-words">
|
||||
<div class="flex <?= $msg['user_sender'] == $currentUserId ? 'justify-end' : 'justify-start' ?> mb-2">
|
||||
<div class="<?= $msg['user_sender'] == $currentUserId ? 'bg-blue-500 text-white' : 'bg-gray-300 text-black' ?> p-2 rounded max-w-xs break-words">
|
||||
<?= htmlspecialchars($msg['nachricht']) ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const currentUserId = <?= $currentUser['id'] ?>;
|
||||
const currentUserId = <?= $currentUserId ?>;
|
||||
let currentChatUserId = null;
|
||||
|
||||
const ws = new WebSocket('ws://localhost:8080');
|
||||
|
||||
Reference in New Issue
Block a user