mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +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
|
```sh
|
||||||
go get
|
go get
|
||||||
go install
|
go install
|
||||||
ergonomadic -conf '/path/to/ergonomadic.json'
|
ergonomadic -conf '/path/to/config.json'
|
||||||
```
|
```
|
||||||
|
@ -199,8 +199,6 @@ type PassCommand struct {
|
|||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
var ErrCannotCheck = errors.New("cannot check password")
|
|
||||||
|
|
||||||
func (cmd *PassCommand) String() string {
|
func (cmd *PassCommand) String() string {
|
||||||
return fmt.Sprintf("PASS(password=%s)", cmd.password)
|
return fmt.Sprintf("PASS(password=%s)", cmd.password)
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ func NewServer(config *Config) *Server {
|
|||||||
return server
|
return server
|
||||||
}
|
}
|
||||||
|
|
||||||
func (server *Server) ProcessCommand(cmd Command) {
|
func (server *Server) processCommand(cmd Command) {
|
||||||
client := cmd.Client()
|
client := cmd.Client()
|
||||||
if DEBUG_SERVER {
|
if DEBUG_SERVER {
|
||||||
log.Printf("%s → %s %s", client, server, cmd)
|
log.Printf("%s → %s %s", client, server, cmd)
|
||||||
@ -103,7 +103,7 @@ func (server *Server) Run() {
|
|||||||
NewClient(server, conn)
|
NewClient(server, conn)
|
||||||
|
|
||||||
case cmd := <-server.commands:
|
case cmd := <-server.commands:
|
||||||
server.ProcessCommand(cmd)
|
server.processCommand(cmd)
|
||||||
|
|
||||||
case client := <-server.idle:
|
case client := <-server.idle:
|
||||||
client.Idle()
|
client.Idle()
|
||||||
@ -682,8 +682,7 @@ func (msg *ListCommand) HandleServer(server *Server) {
|
|||||||
|
|
||||||
if len(msg.channels) == 0 {
|
if len(msg.channels) == 0 {
|
||||||
for _, channel := range server.channels {
|
for _, channel := range server.channels {
|
||||||
if !client.flags[Operator] &&
|
if !client.flags[Operator] && channel.flags[Private] {
|
||||||
(channel.flags[Secret] || channel.flags[Private]) {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
client.RplList(channel)
|
client.RplList(channel)
|
||||||
@ -691,8 +690,7 @@ func (msg *ListCommand) HandleServer(server *Server) {
|
|||||||
} else {
|
} else {
|
||||||
for _, chname := range msg.channels {
|
for _, chname := range msg.channels {
|
||||||
channel := server.channels[chname]
|
channel := server.channels[chname]
|
||||||
if channel == nil || (!client.flags[Operator] &&
|
if channel == nil || (!client.flags[Operator] && channel.flags[Private]) {
|
||||||
(channel.flags[Secret] || channel.flags[Private])) {
|
|
||||||
client.ErrNoSuchChannel(chname)
|
client.ErrNoSuchChannel(chname)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user