minimal channel mode command

This commit is contained in:
Jeremy Latt
2014-02-08 18:14:39 -08:00
parent a0eed1d687
commit d8951e1b48
4 changed files with 68 additions and 11 deletions
+12 -2
View File
@@ -234,6 +234,11 @@ func RplEndOfWhois(server *Server) Reply {
return NewNumericReply(server, RPL_ENDOFWHOIS, ":End of WHOIS list")
}
func RplChannelModeIs(server *Server, channel *Channel) Reply {
return NewNumericReply(server, RPL_CHANNELMODEIS, "%s %s",
channel.name, channel.ModeString())
}
// errors (also numeric)
func ErrAlreadyRegistered(source Identifier) Reply {
@@ -261,8 +266,8 @@ func ErrNeedMoreParams(source Identifier, command string) Reply {
"%s :Not enough parameters", command)
}
func ErrNoSuchChannel(source Identifier, channel string) Reply {
return NewNumericReply(source, ERR_NOSUCHCHANNEL,
func ErrNoSuchChannel(server *Server, channel string) Reply {
return NewNumericReply(server, ERR_NOSUCHCHANNEL,
"%s :No such channel", channel)
}
@@ -311,3 +316,8 @@ func ErrRestricted(server *Server) Reply {
func ErrNoSuchServer(server *Server, target string) Reply {
return NewNumericReply(server, ERR_NOSUCHSERVER, "%s :No such server", target)
}
func ErrUserNotInChannel(server *Server, nick string, channel *Channel) Reply {
return NewNumericReply(server, ERR_USERNOTINCHANNEL,
"%s %s :They aren't on that channel", nick, channel.name)
}