Changeset 151 in code
- Timestamp:
- Mar 25, 2020, 9:57:48 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/service.go
r150 r151 94 94 handle: handleServiceCreateNetwork, 95 95 }, 96 "status": { 97 desc: "show a list of saved networks and their current status", 98 handle: handleServiceNetworkStatus, 99 }, 96 100 }, 97 101 }, … … 177 181 return nil 178 182 } 183 184 func handleServiceNetworkStatus(dc *downstreamConn, params []string) error { 185 dc.user.forEachNetwork(func(net *network) { 186 var statuses []string 187 var details string 188 if uc := net.upstream(); uc != nil { 189 statuses = append(statuses, "connected as "+uc.nick) 190 details = fmt.Sprintf("%v channels", len(uc.channels)) 191 } else { 192 statuses = append(statuses, "disconnected") 193 } 194 195 if net == dc.network { 196 statuses = append(statuses, "current") 197 } 198 199 s := fmt.Sprintf("%v (%v) [%v]", net.GetName(), net.Addr, strings.Join(statuses, ", ")) 200 if details != "" { 201 s += ": " + details 202 } 203 sendServicePRIVMSG(dc, s) 204 }) 205 return nil 206 } -
trunk/soju.1.scd
r150 r151 102 102 is used. 103 103 104 *network status* 105 Show a list of saved networks and their current status. 106 104 107 # AUTHORS 105 108
Note:
See TracChangeset
for help on using the changeset viewer.