commit 080b033f3785f4f122e03467f04256304f024e58
parent b045fdd950e08fd97481842202d7849b2c8b5be6
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 22 May 2023 20:01:07 -0700
fix UI
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -4952,6 +4952,11 @@ func ChatStreamMessagesHandler(c echo.Context) error {
displayIgnoredMessages := false
msgs, _ := db.GetChatMessages(room.ID, authUser.Username, authUser.ID, pmOnlyQuery, mentionsOnlyQuery, displayHellbanned, authUser.DisplayIgnored, authUser.DisplayModerators, displayIgnoredMessages)
data.Messages = msgs
+ bools := []bool{authUser.DisplayDeleteButton}
+ if authUser.IsModerator() {
+ bools = append(bools, authUser.DisplayHellbanButton, authUser.DisplayKickButton)
+ }
+ data.NbButtons = utils.CountBools(bools...)
_, _ = c.Response().Write([]byte("<div>" + v1.RenderMessages(authUser, data, csrf, config.NullUsername) + "</div>"))
c.Response().Flush()