Changeset 66 in code for trunk/upstream.go
- Timestamp:
- Feb 18, 2020, 4:07:58 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r64 r66 110 110 switch msg.Command { 111 111 case "PING": 112 // TODO: handle params 112 var from, to string 113 if len(msg.Params) >= 1 { 114 from = msg.Params[0] 115 } 116 if len(msg.Params) >= 2 { 117 to = msg.Params[1] 118 } 119 120 if to != "" && to != uc.srv.Hostname { 121 return fmt.Errorf("invalid PING destination %q", to) 122 } 123 124 params := []string{uc.srv.Hostname} 125 if from != "" { 126 params = append(params, from) 127 } 113 128 uc.SendMessage(&irc.Message{ 114 129 Command: "PONG", 115 Params: []string{uc.srv.Hostname},130 Params: params, 116 131 }) 117 132 return nil
Note:
See TracChangeset
for help on using the changeset viewer.