mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 02:32:39 +01:00
minor cleanup
This commit is contained in:
parent
72726a39b8
commit
cc6f764c85
@ -40,5 +40,5 @@ byte strings. You can generate them with e.g. `ergonomadic -genpasswd
|
||||
```sh
|
||||
go get
|
||||
go install
|
||||
ergonomadic -conf '/path/to/ergonomadic.json'
|
||||
ergonomadic -conf '/path/to/config.json'
|
||||
```
|
||||
|
@ -199,8 +199,6 @@ type PassCommand struct {
|
||||
err error
|
||||
}
|
||||
|
||||
var ErrCannotCheck = errors.New("cannot check password")
|
||||
|
||||
func (cmd *PassCommand) String() string {
|
||||
return fmt.Sprintf("PASS(password=%s)", cmd.password)
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func NewServer(config *Config) *Server {
|
||||
return server
|
||||
}
|
||||
|
||||
func (server *Server) ProcessCommand(cmd Command) {
|
||||
func (server *Server) processCommand(cmd Command) {
|
||||
client := cmd.Client()
|
||||
if DEBUG_SERVER {
|
||||
log.Printf("%s → %s %s", client, server, cmd)
|
||||
@ -103,7 +103,7 @@ func (server *Server) Run() {
|
||||
NewClient(server, conn)
|
||||
|
||||
case cmd := <-server.commands:
|
||||
server.ProcessCommand(cmd)
|
||||
server.processCommand(cmd)
|
||||
|
||||
case client := <-server.idle:
|
||||
client.Idle()
|
||||
@ -682,8 +682,7 @@ func (msg *ListCommand) HandleServer(server *Server) {
|
||||
|
||||
if len(msg.channels) == 0 {
|
||||
for _, channel := range server.channels {
|
||||
if !client.flags[Operator] &&
|
||||
(channel.flags[Secret] || channel.flags[Private]) {
|
||||
if !client.flags[Operator] && channel.flags[Private] {
|
||||
continue
|
||||
}
|
||||
client.RplList(channel)
|
||||
@ -691,8 +690,7 @@ func (msg *ListCommand) HandleServer(server *Server) {
|
||||
} else {
|
||||
for _, chname := range msg.channels {
|
||||
channel := server.channels[chname]
|
||||
if channel == nil || (!client.flags[Operator] &&
|
||||
(channel.flags[Secret] || channel.flags[Private])) {
|
||||
if channel == nil || (!client.flags[Operator] && channel.flags[Private]) {
|
||||
client.ErrNoSuchChannel(chname)
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user