/nick: Avoid announcing when it's the same nick (#234)#237
/nick: Avoid announcing when it's the same nick (#234)#237shazow merged 1 commit intoshazow:masterfrom
Conversation
|
Hi there, is there an existing issue for this? Please make sure all changes are run through |
chat/command.go
Outdated
| newID := SanitizeName(args[0]) | ||
| if newID == oldID { | ||
| body := "New nickname the same as previous nickname." | ||
| u.Send(message.NewSystemMsg(body, u)) |
There was a problem hiding this comment.
I think you can just return an error here, like above. Please try to keep it in the same style as the other errors.
return errors.New("new name is the same as the original")There was a problem hiding this comment.
Done, I force pushed, not sure if you prefer new commits each time and then a squash at the end, but this is a pretty small change.
f3d4502 to
f0f8ad4
Compare
|
Yup, there is an existing issue (referenced in the commit summary). This fixes #234 Hmm, I ran gofmt, but it seems like my changes still have spaces wile the file uses tabs. |
f0f8ad4 to
46881a1
Compare
|
Looks good, thank you! I assume you tried it and it works? Our CI is broken right now, unfortunately. 😭 |
|
@shazow yup, tested locally. I didn't see anywhere to add an applicable unit test :/ |
|
Excellent, thank you! No worries, it's a pretty change test so as long as it doesn't break any existing tests I'm happy. Unfortunately our current state of tests is not great... A bunch of things broke on Linux (still works on Mac), and haven't had a chance to fix them. :( Let me know if you're interested in helping with that! :) |
|
@shazow Definitely happy to help! |
No description provided.