From ca343305997ad0bb5e56ed3082fd4d548486e13d Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 10 May 2017 16:03:07 -0700 Subject: [PATCH] hashtag streaming --- main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.go b/main.go index c858c93..b75b8e3 100644 --- a/main.go +++ b/main.go @@ -170,6 +170,18 @@ func (s *Server) HandleConn(ctx context.Context) { msg.Host = s.cfg.ServerName msg.Command = "PONG" s.iw.WriteMessage(msg) + case "JOIN": + // hashtag streaming + target := msg.Params[0] + if target[0] != '#' { + s.iw.Writef("%s 404 %s :Unknown hashtag", s.cfg.ServerName, s.nickname) + continue + } + + err = s.stream(ctx, target, "hashtag", target) + if err != nil { + ln.Error(err, s.F(), ln.F{"action": "hashtag_stream", "hashtag": target}) + } default: s.iw.Writef(":%s 421 %s :Unknown command %q", s.cfg.ServerName, s.nickname, msg.Command) continue