Example #1
0
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
}
Example #2
0
func recvFromServer(server core.Conn, msg *irc.Message) events.EventAction {
	server.Network().SendToClients(msg)
	return events.EventStop
}
Example #3
0
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
}
Example #4
0
func shutdown(conn core.Conn, argv []string) {
	log.Stderrf("shutdown command from %s\n", conn.RemoteAddr())
	runloop.Quit()
}
Example #5
0
func sendLines(conn core.Conn, lines []string) {
	network := conn.Network()
	for _, line := range lines {
		network.SendNoticeToClient(conn, line)
	}
}