From 7feb277a33e2317d20a0c88ce41300abf888872a Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sat, 30 Nov 2019 10:27:06 -0500 Subject: [PATCH] Don't allow names that are the access pin If a user tries to enter the pin as their name return an error instead of accepting the name. --- chatroom.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chatroom.go b/chatroom.go index 89743a6..de55e03 100644 --- a/chatroom.go +++ b/chatroom.go @@ -59,6 +59,11 @@ func (cr *ChatRoom) Join(conn *chatConnection, data common.JoinData) (*Client, e } } + if settings.RoomAccess == AccessPin && data.Name == settings.RoomAccessPin { + sendHiddenMessage(common.CdNotify, "That's the access pin! Please enter a name.") + return nil, UserFormatError{Name: data.Name} + } + if !common.IsValidName(data.Name) { sendHiddenMessage(common.CdNotify, common.InvalidNameError) return nil, UserFormatError{Name: data.Name}