Skip to content

/nick: Avoid announcing when it's the same nick (#234)#237

Merged
shazow merged 1 commit intoshazow:masterfrom
ograff:same_nick_issue_234
Jun 13, 2017
Merged

/nick: Avoid announcing when it's the same nick (#234)#237
shazow merged 1 commit intoshazow:masterfrom
ograff:same_nick_issue_234

Conversation

@ograff
Copy link
Copy Markdown
Contributor

@ograff ograff commented Jun 11, 2017

No description provided.

@shazow
Copy link
Copy Markdown
Owner

shazow commented Jun 11, 2017

Hi there, is there an existing issue for this?

Please make sure all changes are run through gofmt and such.

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))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ograff ograff force-pushed the same_nick_issue_234 branch from f3d4502 to f0f8ad4 Compare June 11, 2017 20:55
@ograff
Copy link
Copy Markdown
Contributor Author

ograff commented Jun 11, 2017

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.

@ograff ograff force-pushed the same_nick_issue_234 branch from f0f8ad4 to 46881a1 Compare June 11, 2017 21:01
@shazow
Copy link
Copy Markdown
Owner

shazow commented Jun 12, 2017

Looks good, thank you! I assume you tried it and it works? Our CI is broken right now, unfortunately. 😭

@ograff
Copy link
Copy Markdown
Contributor Author

ograff commented Jun 13, 2017

@shazow yup, tested locally. I didn't see anywhere to add an applicable unit test :/

@shazow shazow merged commit a631215 into shazow:master Jun 13, 2017
@shazow
Copy link
Copy Markdown
Owner

shazow commented Jun 13, 2017

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! :)

@ograff
Copy link
Copy Markdown
Contributor Author

ograff commented Jun 14, 2017

@shazow Definitely happy to help!

@ograff ograff deleted the same_nick_issue_234 branch June 14, 2017 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants