notice command

This commit is contained in:
Jeremy Latt
2014-02-11 17:11:59 -08:00
parent 09887b2db3
commit 6daf81ea91
5 changed files with 55 additions and 0 deletions
+20
View File
@@ -475,3 +475,23 @@ func (msg *IsOnCommand) HandleServer(server *Server) {
func (msg *MOTDCommand) HandleServer(server *Server) {
server.MOTD(msg.Client())
}
func (msg *NoticeCommand) HandleServer(server *Server) {
if IsChannel(msg.target) {
channel := server.channels[msg.target]
if channel == nil {
msg.Client().Reply(ErrNoSuchChannel(server, msg.target))
return
}
channel.commands <- msg
return
}
target := server.clients[msg.target]
if target == nil {
msg.Client().Reply(ErrNoSuchNick(server, msg.target))
return
}
target.Reply(RplPrivMsg(msg.Client(), target, msg.message))
}