Implemented moderated mode

This commit is contained in:
Harry Jeffery 2013-08-27 19:40:59 +01:00
parent 70a17eb44d
commit 3f325e6652

View File

@ -153,6 +153,14 @@ func (s *Server) handleEvent(e Event) {
client, clientExists := s.clientMap[strings.ToLower(args[0])] client, clientExists := s.clientMap[strings.ToLower(args[0])]
if chanExists { 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 { for _, c := range channel.clientMap {
if c != e.client { if c != e.client {
c.reply(rplMsg, e.client.nick, args[0], message) c.reply(rplMsg, e.client.nick, args[0], message)