From c8ee351831d4fc066457af1738d6b9e401af318e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 18 Oct 2015 13:01:49 +0200 Subject: Limit rfc response on public channel --- rfc.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rfc.go b/rfc.go index 3b916bb..288f645 100644 --- a/rfc.go +++ b/rfc.go @@ -21,6 +21,9 @@ func (_ RFC) Handle(conn *irc.Conn, line *irc.Line) { if f := strings.Fields(line.Text()); len(f) > 1 { kw := strings.ToLower(f[1]) if e, ok := rfcKW[kw]; ok { + if line.Public() && len(e) > 10 { + e = append(e[:10], "...") + } s := strings.Join(e, ", ") conn.Notice(line.Target(), s) } else { @@ -30,7 +33,7 @@ func (_ RFC) Handle(conn *irc.Conn, line *irc.Line) { } func (_ RFC) Help() string { - return "search rfc by keyword" + return "search rfc by keyword (msg privat to see all matches)" } func ExtractRFC(conn *irc.Conn, line *irc.Line) { -- cgit v1.2.3