summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-10-18 13:01:49 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-10-18 13:01:49 +0200
commitc8ee351831d4fc066457af1738d6b9e401af318e (patch)
treeaaf8b3c8fdf1c889f992418692844b3b25ae412c
parent541dbbd497078834a722c049ad9382d7d4d8cb33 (diff)
Limit rfc response on public channel
-rw-r--r--rfc.go5
1 files changed, 4 insertions, 1 deletions
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) {