aboutsummaryrefslogtreecommitdiff
path: root/internal/chat/chan.go
diff options
context:
space:
mode:
author2025-12-30 20:06:25 +0300
committer2025-12-30 20:06:25 +0300
commit2111f328c1dc619be568e325ce7138c8e6e3b0b2 (patch)
treefcb65b69bb75b1146ec7c8e78f9e8ba4d37d4d22 /internal/chat/chan.go
parentначальный коммит (diff)
downloadqchat-2111f328c1dc619be568e325ce7138c8e6e3b0b2.tar.gz
qchat-2111f328c1dc619be568e325ce7138c8e6e3b0b2.tar.bz2
qchat-2111f328c1dc619be568e325ce7138c8e6e3b0b2.tar.xz
qchat-2111f328c1dc619be568e325ce7138c8e6e3b0b2.zip
немного поправил отображение
Diffstat (limited to 'internal/chat/chan.go')
-rw-r--r--internal/chat/chan.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/chat/chan.go b/internal/chat/chan.go
index ae78bb6..bc2b70f 100644
--- a/internal/chat/chan.go
+++ b/internal/chat/chan.go
@@ -29,6 +29,12 @@ func (c *Channel) processEvent(ev any) {
slog.Info("channel event", slog.String("channel", c.Name), slog.Any("event", ev))
for u := range c.Users {
+ if ev, ok := ev.(Message); ok {
+ if ev.User == u {
+ // Do not return user message to him
+ continue
+ }
+ }
select {
case u.Events <- ev:
default: