From 3f325e6652acf2fd241d016e10ed6b7cf1af37c1 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Tue, 27 Aug 2013 19:40:59 +0100 Subject: [PATCH] Implemented moderated mode --- server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server.go b/server.go index 8d7dbc1..f5ddd7d 100644 --- a/server.go +++ b/server.go @@ -153,6 +153,14 @@ func (s *Server) handleEvent(e Event) { client, clientExists := s.clientMap[strings.ToLower(args[0])] if chanExists { + if channel.mode.moderated { + clientMode := channel.modeMap[strings.ToLower(e.client.nick)] + if !clientMode.operator && !clientMode.voice { + //It's moderated and we're not +v or +o, do nothing + e.client.reply(errCannotSend, args[0]) + return + } + } for _, c := range channel.clientMap { if c != e.client { c.reply(rplMsg, e.client.nick, args[0], message)