func handlePing(conn core.Conn, pingMsg *irc.Message) events.EventAction { if pingMsg.Command != "PING" { return events.EventContinue } conn.Send(&irc.Message{Command: "PONG", Params: []string{"bouncin"}}) // TODO use proper server name param return events.EventStop }
func recvFromServer(server core.Conn, msg *irc.Message) events.EventAction { server.Network().SendToClients(msg) return events.EventStop }
func recvFromClient(client core.Conn, msg *irc.Message) events.EventAction { // TODO any filtering/mangling necessary here? // TODO need to send to other clients? client.Network().SendToServer(msg) return events.EventStop }
func shutdown(conn core.Conn, argv []string) { log.Stderrf("shutdown command from %s\n", conn.RemoteAddr()) runloop.Quit() }
func sendLines(conn core.Conn, lines []string) { network := conn.Network() for _, line := range lines { network.SendNoticeToClient(conn, line) } }