summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-08-04 23:36:04 +0500
committerilotterytea <iltsu@alright.party>2025-08-04 23:36:04 +0500
commitaf7be5b590d1057fe4a4f79a0c4b2d68fdff5fa8 (patch)
treea377344f6086553d8c9f93eaf57b6b625d24f46c
parent72eb2379d42636efa3075d5cc031c438b6f99d96 (diff)
upd: don't repeat nick if user has sent multiple messages at once
-rw-r--r--web/index.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/index.php b/web/index.php
index 392913e..cc4be55 100644
--- a/web/index.php
+++ b/web/index.php
@@ -118,9 +118,12 @@ if (isset($room)) {
<td class="datetime"><a
href="/?r=<?= urlencode($room['name']) ?>&d=<?= urlencode($date) ?>#msgid=<?= $m['id'] ?>"><?= date('H:i', strtotime($m['sent_at'])) ?></a>
</td>
- <td class="nick"><?= $m['nick'] ?></td>
+ <td class="nick">
+ <?= (!isset($prev_msg_nick) || $prev_msg_nick != $m['nick']) ? $m['nick'] : '' ?>
+ </td>
<td class="content"><?= $m['params'] ?></td>
</tr>
+ <?php $prev_msg_nick = $m['nick']; ?>
<?php endforeach; ?>
</table>
<?php endif; ?>