- Timestamp:
- Oct 8, 2021, 8:52:03 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/soju.1.scd
r612 r615 330 330 Show some bouncer statistics. Only admins can query this information. 331 331 332 *server notice* <message> 333 Broadcast a notice. All currently connected bouncer users will receive the 334 message from the special _BouncerServ_ service. Only admins can broadcast a 335 notice. 336 332 337 # AUTHORS 333 338 -
trunk/service.go
r614 r615 295 295 admin: true, 296 296 }, 297 "notice": { 298 desc: "broadcast a notice to all connected bouncer users", 299 handle: handleServiceServerNotice, 300 admin: true, 301 }, 297 302 }, 298 303 admin: true, … … 979 984 return nil 980 985 } 986 987 func handleServiceServerNotice(dc *downstreamConn, params []string) error { 988 if len(params) != 1 { 989 return fmt.Errorf("expected exactly one argument") 990 } 991 text := params[0] 992 993 dc.logger.Printf("broadcasting bouncer-wide NOTICE: %v", text) 994 995 broadcastMsg := &irc.Message{ 996 Prefix: servicePrefix, 997 Command: "NOTICE", 998 Params: []string{"$" + dc.srv.Hostname, text}, 999 } 1000 dc.srv.forEachUser(func(u *user) { 1001 u.events <- eventBroadcast{broadcastMsg} 1002 }) 1003 return nil 1004 }
Note:
See TracChangeset
for help on using the changeset viewer.