1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-12 10:41:42 +00:00

Split long messages at a configurable length. Fixes #29.

This commit is contained in:
Alex Bramley 2013-03-17 01:21:09 +00:00
parent 0b64613fe3
commit 5c56572b0d
3 changed files with 146 additions and 12 deletions

View file

@ -71,6 +71,10 @@ type Config struct {
// Configurable panic recovery for all handlers.
Recover func(*Conn, *Line)
// Split PRIVMSGs, NOTICEs and CTCPs longer than
// SplitLen characters over multiple lines.
SplitLen int
}
func NewConfig(nick string, args ...string) *Config {
@ -79,6 +83,7 @@ func NewConfig(nick string, args ...string) *Config {
PingFreq: 3 * time.Minute,
NewNick: func(s string) string { return s + "_" },
Recover: (*Conn).LogPanic, // in dispatch.go
SplitLen: 450,
}
cfg.Me.Ident = "goirc"
if len(args) > 0 && args[0] != "" {