3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 03:02:48 +01:00

minor cleanup/refactoring

This commit is contained in:
Jeremy Latt 2014-03-06 17:07:23 -08:00
parent adde42a1bf
commit 12ae89ca14
2 changed files with 6 additions and 7 deletions

View File

@ -37,9 +37,8 @@ func ExpandUserHost(userhost string) (expanded string) {
return return
} }
func QuoteLike(userhost string) (like string) { func QuoteLike(userhost string) string {
like = likeQuoter.Replace(userhost) return likeQuoter.Replace(userhost)
return
} }
type ClientLookupSet struct { type ClientLookupSet struct {

View File

@ -329,7 +329,7 @@ func (m *NickCommand) HandleRegServer(s *Server) {
} }
func (msg *RFC1459UserCommand) HandleRegServer(server *Server) { func (msg *RFC1459UserCommand) HandleRegServer(server *Server) {
msg.HandleRegServer2(server) msg.setUserInfo(server)
} }
func (msg *RFC2812UserCommand) HandleRegServer(server *Server) { func (msg *RFC2812UserCommand) HandleRegServer(server *Server) {
@ -341,10 +341,10 @@ func (msg *RFC2812UserCommand) HandleRegServer(server *Server) {
} }
client.RplUModeIs(client) client.RplUModeIs(client)
} }
msg.HandleRegServer2(server) msg.setUserInfo(server)
} }
func (msg *UserCommand) HandleRegServer2(server *Server) { func (msg *UserCommand) setUserInfo(server *Server) {
client := msg.Client() client := msg.Client()
server.clients.Remove(client) server.clients.Remove(client)
client.username, client.realname = msg.username, msg.realname client.username, client.realname = msg.username, msg.realname
@ -497,7 +497,7 @@ func (m *ModeCommand) HandleServer(s *Server) {
return return
} }
changes := make(ModeChanges, 0) changes := make(ModeChanges, 0, len(m.changes))
for _, change := range m.changes { for _, change := range m.changes {
switch change.mode { switch change.mode {