From 07589e7099e925666aa636efd986231219c1fa76 Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sat, 23 Mar 2019 18:09:27 -0400 Subject: [PATCH 1/3] Don't allow banning admins --- chatroom.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chatroom.go b/chatroom.go index 8d128a4..a699fd6 100644 --- a/chatroom.go +++ b/chatroom.go @@ -182,6 +182,10 @@ func (cr *ChatRoom) Ban(name string) string { return "Cannot find that name" } + if client.IsAdmin { + return "You cannot ban an admin Jebaited" + } + names := []string{} host := client.Host() color := client.color From b4ae3fa9f81699cee089a37f2167bf1ddf0b2e64 Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sat, 23 Mar 2019 18:10:32 -0400 Subject: [PATCH 2/3] Fix non-chat empty messages Only refuse to send empty message data to the server if it is chat data. All other data types can be sent with an empty message (eg, ping). --- wasm/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wasm/main.go b/wasm/main.go index 297c3aa..cdd5e7f 100644 --- a/wasm/main.go +++ b/wasm/main.go @@ -224,7 +224,7 @@ func recieve(v []js.Value) { } func websocketSend(msg string, dataType common.ClientDataType) error { - if strings.TrimSpace(msg) == "" { + if strings.TrimSpace(msg) == "" && dataType == common.CdMessage { return nil } From 37cf2f7811b0fee54fe40762acb4619af8ff406d Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sat, 23 Mar 2019 18:13:55 -0400 Subject: [PATCH 3/3] Fix auto-scrolling with emotes All emotes are set to have a height of 28px. This fixes the auto-scroll on message when the message has emotes, but it also forces all emotes to be 28px high. --- common/emotes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/emotes.go b/common/emotes.go index 9be8b42..f2ff30b 100644 --- a/common/emotes.go +++ b/common/emotes.go @@ -16,7 +16,7 @@ func ParseEmotesArray(words []string) []string { found := false for key, val := range Emotes { if key == word { - newWords = append(newWords, fmt.Sprintf("", val, key)) + newWords = append(newWords, fmt.Sprintf(``, val, key)) found = true } }