From 8240b650d6f02bd832620a7af5dea27e8f3b69e9 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 29 Aug 2013 18:08:39 +0100 Subject: [PATCH] Implemented secret mode for channels --- server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.go b/server.go index ccef227..47a1040 100644 --- a/server.go +++ b/server.go @@ -242,6 +242,12 @@ func (s *Server) handleEvent(e Event) { chanList := make([]string, 0, len(s.channelMap)) for channelName, channel := range s.channelMap { + if channel.mode.secret { + if _, inChannel := channel.clientMap[strings.ToLower(e.client.nick)]; !inChannel { + //Not in the channel, skip + continue + } + } listItem := fmt.Sprintf("%s %d :%s", channelName, len(channel.clientMap), channel.topic) chanList = append(chanList, listItem) }