Changeset 577 in code for trunk/service.go
- Timestamp:
- Jul 7, 2021, 8:34:46 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/service.go
r575 r577 223 223 handle: handleServiceNetworkDelete, 224 224 }, 225 "quote": { 226 usage: "<name> <command>", 227 desc: "send a raw line to a network", 228 handle: handleServiceNetworkQuote, 229 }, 225 230 }, 226 231 }, … … 578 583 } 579 584 585 func handleServiceNetworkQuote(dc *downstreamConn, params []string) error { 586 if len(params) != 2 { 587 return fmt.Errorf("expected exactly two arguments") 588 } 589 590 net := dc.user.getNetwork(params[0]) 591 if net == nil { 592 return fmt.Errorf("unknown network %q", params[0]) 593 } 594 595 uc := net.conn 596 if uc == nil { 597 return fmt.Errorf("network %q is not currently connected", params[0]) 598 } 599 600 m, err := irc.ParseMessage(params[1]) 601 if err != nil { 602 return fmt.Errorf("failed to parse command %q: %v", params[1], err) 603 } 604 uc.SendMessage(m) 605 606 sendServicePRIVMSG(dc, fmt.Sprintf("sent command to %q", net.GetName())) 607 return nil 608 } 609 580 610 func handleServiceCertfpGenerate(dc *downstreamConn, params []string) error { 581 611 fs := newFlagSet()
Note:
See TracChangeset
for help on using the changeset viewer.