Przeglądaj źródła

minor cleanup

tags/v0.1.0
Jeremy Latt 10 lat temu
rodzic
commit
cc6f764c85
3 zmienionych plików z 5 dodań i 9 usunięć
  1. 1
    1
      README.md
  2. 0
    2
      irc/commands.go
  3. 4
    6
      irc/server.go

+ 1
- 1
README.md Wyświetl plik

@@ -40,5 +40,5 @@ byte strings. You can generate them with e.g. `ergonomadic -genpasswd
40 40
 ```sh
41 41
 go get
42 42
 go install
43
-ergonomadic -conf '/path/to/ergonomadic.json'
43
+ergonomadic -conf '/path/to/config.json'
44 44
 ```

+ 0
- 2
irc/commands.go Wyświetl plik

@@ -199,8 +199,6 @@ type PassCommand struct {
199 199
 	err      error
200 200
 }
201 201
 
202
-var ErrCannotCheck = errors.New("cannot check password")
203
-
204 202
 func (cmd *PassCommand) String() string {
205 203
 	return fmt.Sprintf("PASS(password=%s)", cmd.password)
206 204
 }

+ 4
- 6
irc/server.go Wyświetl plik

@@ -52,7 +52,7 @@ func NewServer(config *Config) *Server {
52 52
 	return server
53 53
 }
54 54
 
55
-func (server *Server) ProcessCommand(cmd Command) {
55
+func (server *Server) processCommand(cmd Command) {
56 56
 	client := cmd.Client()
57 57
 	if DEBUG_SERVER {
58 58
 		log.Printf("%s → %s %s", client, server, cmd)
@@ -103,7 +103,7 @@ func (server *Server) Run() {
103 103
 			NewClient(server, conn)
104 104
 
105 105
 		case cmd := <-server.commands:
106
-			server.ProcessCommand(cmd)
106
+			server.processCommand(cmd)
107 107
 
108 108
 		case client := <-server.idle:
109 109
 			client.Idle()
@@ -682,8 +682,7 @@ func (msg *ListCommand) HandleServer(server *Server) {
682 682
 
683 683
 	if len(msg.channels) == 0 {
684 684
 		for _, channel := range server.channels {
685
-			if !client.flags[Operator] &&
686
-				(channel.flags[Secret] || channel.flags[Private]) {
685
+			if !client.flags[Operator] && channel.flags[Private] {
687 686
 				continue
688 687
 			}
689 688
 			client.RplList(channel)
@@ -691,8 +690,7 @@ func (msg *ListCommand) HandleServer(server *Server) {
691 690
 	} else {
692 691
 		for _, chname := range msg.channels {
693 692
 			channel := server.channels[chname]
694
-			if channel == nil || (!client.flags[Operator] &&
695
-				(channel.flags[Secret] || channel.flags[Private])) {
693
+			if channel == nil || (!client.flags[Operator] && channel.flags[Private]) {
696 694
 				client.ErrNoSuchChannel(chname)
697 695
 				continue
698 696
 			}

Ładowanie…
Anuluj
Zapisz