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

Fixes #234
This commit is contained in:
Oliver Graff authored and Andrey Petrov committed 2017-06-13 11:12:32 -04:00
1 parent 25689a88ed
commit a631215f5b
1 file changed
+5 -1
+5 -1
View File
@@ -155,7 +155,11 @@ func InitCommands(c *Commands) {
}
oldID := member.ID()
member.SetID(SanitizeName(args[0]))
newID := SanitizeName(args[0])
if newID == oldID {
return errors.New("new name is the same as the original")
}
member.SetID(newID)
err := room.Rename(oldID, member)
if err != nil {
member.SetID(oldID)