File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ func (c *client) readInput() {
42
42
43
43
func (c * client ) readCommand (cmd string , args []string ) {
44
44
log .Printf ("command you entered: %s" , cmd )
45
- if cmd != "/randomnick" && cmd != "/nick" && cmd != "/help" && cmd != "/quit" {
45
+ if cmd != "/randomnick" && cmd != "/nick" && cmd != "/help" && cmd != "/quit" && c . nick == "anonymous" {
46
46
c .err (fmt .Errorf ("pick a new nickname, otherwise enter /randomnick" ))
47
47
} else {
48
48
switch cmd {
Original file line number Diff line number Diff line change @@ -48,8 +48,10 @@ func (s *server) newClient(conn net.Conn) {
48
48
c .msg (fmt .Sprintf ("type '/help' to see the list of commands.\n " ))
49
49
c .msg (fmt .Sprintf ("type '/nick {nickname}' to assign a nickname to yourself.\n " ))
50
50
c .msg (fmt .Sprintf ("If you want to pick a random nickname, type /randomnick" ))
51
- // when a user creates a session, a nickname should be picked before
52
- // doing anything else
51
+
52
+ // // when a user creates a session, a nickname should be picked before
53
+ // // doing anything else
54
+ // new_session := true
53
55
c .readInput ()
54
56
}
55
57
You can’t perform that action at this time.
0 commit comments