mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
minor cleanup/refactoring
This commit is contained in:
parent
adde42a1bf
commit
12ae89ca14
@ -37,9 +37,8 @@ func ExpandUserHost(userhost string) (expanded string) {
|
||||
return
|
||||
}
|
||||
|
||||
func QuoteLike(userhost string) (like string) {
|
||||
like = likeQuoter.Replace(userhost)
|
||||
return
|
||||
func QuoteLike(userhost string) string {
|
||||
return likeQuoter.Replace(userhost)
|
||||
}
|
||||
|
||||
type ClientLookupSet struct {
|
||||
|
@ -329,7 +329,7 @@ func (m *NickCommand) HandleRegServer(s *Server) {
|
||||
}
|
||||
|
||||
func (msg *RFC1459UserCommand) HandleRegServer(server *Server) {
|
||||
msg.HandleRegServer2(server)
|
||||
msg.setUserInfo(server)
|
||||
}
|
||||
|
||||
func (msg *RFC2812UserCommand) HandleRegServer(server *Server) {
|
||||
@ -341,10 +341,10 @@ func (msg *RFC2812UserCommand) HandleRegServer(server *Server) {
|
||||
}
|
||||
client.RplUModeIs(client)
|
||||
}
|
||||
msg.HandleRegServer2(server)
|
||||
msg.setUserInfo(server)
|
||||
}
|
||||
|
||||
func (msg *UserCommand) HandleRegServer2(server *Server) {
|
||||
func (msg *UserCommand) setUserInfo(server *Server) {
|
||||
client := msg.Client()
|
||||
server.clients.Remove(client)
|
||||
client.username, client.realname = msg.username, msg.realname
|
||||
@ -497,7 +497,7 @@ func (m *ModeCommand) HandleServer(s *Server) {
|
||||
return
|
||||
}
|
||||
|
||||
changes := make(ModeChanges, 0)
|
||||
changes := make(ModeChanges, 0, len(m.changes))
|
||||
|
||||
for _, change := range m.changes {
|
||||
switch change.mode {
|
||||
|
Loading…
Reference in New Issue
Block a user