From f51bd29e078a34e28a5c2025aa043a4af96cded4 Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Sun, 8 May 2016 13:27:37 +1200 Subject: [PATCH] 'greentext' filter --HG-- branch : nmdc-ircfrontend --- TODO.txt | 9 ++------- server.go | 10 +++++++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/TODO.txt b/TODO.txt index 1a44adf..139365a 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,17 +1,12 @@ -PRE-RELEASE -=========== - -- client descriptions (CTCP USERINFO) - WISHLIST ======== -- "implying" colours - - send client keepalives (PING) /and/ ensure we get a reply (PONG) +- automatic markdown bold/italic formatting + - client version sync (CTCP VERSION) - support changing nick (via reconnecting) diff --git a/server.go b/server.go index 656aadc..afd2084 100644 --- a/server.go +++ b/server.go @@ -187,7 +187,15 @@ func reformatOutgoingMessageBody(body string) string { } func reformatIncomingMessageBody(body string) string { - return body + + // "Greentext" filter + // TODO markdown filters + if len(body) > 0 && body[0] == '>' { + return "\x033" + strings.Replace(body, "implying", "\x02implying\x02", -1) + + } else { + return body + } } func (s *Server) upstreamWorker() {