summaryrefslogtreecommitdiff
path: root/internal/client/ui
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-02-10 18:04:38 +0200
committerKyren223 <Kyren223@proton.me>2025-02-10 18:04:38 +0200
commit9da5aa5be455f007e149484f11f5f0f399d503ca (patch)
tree5954ca2d8f933a13a0026dead22c8a18151f8312 /internal/client/ui
parent5eb32d5556007c1ebf7d2baa9f87306730551a93 (diff)
@everyone is now sent as normal text when a user doesn't have permission
to send it (instead of just disappearing)
Diffstat (limited to 'internal/client/ui')
-rw-r--r--internal/client/ui/core/chat/chat.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go
index b8a2075..8084c9b 100644
--- a/internal/client/ui/core/chat/chat.go
+++ b/internal/client/ui/core/chat/chat.go
@@ -680,9 +680,12 @@ func (m *Model) sendMessage() tea.Cmd {
value := message[len(PingPrefix):index]
switch value {
case "everyone":
- pingValue := packet.PingEveryone
- ping = &pingValue
- message = message[index+1:]
+ member := state.State.Members[*networkId][*state.UserID]
+ if member.IsAdmin {
+ pingValue := packet.PingEveryone
+ ping = &pingValue
+ message = message[index+1:]
+ }
case "admins":
pingValue := packet.PingAdmins
ping = &pingValue