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
+16
View File
@@ -23,6 +23,17 @@ type ChannelCommand interface {
HandleChannel(channel *Channel)
}
func IsChannel(target string) bool {
if target == "" {
return false
}
switch target[0] {
case '&', '#', '+', '!':
return true
}
return false
}
// NewChannel creates a new channel from a `Server` and a `name`
// string, which must be unique on the server.
func NewChannel(s *Server, name string) *Channel {
@@ -106,6 +117,11 @@ func (channel *Channel) String() string {
return channel.Id()
}
// <mode> <mode params>
func (channel *Channel) ModeString() string {
return ""
}
func (channel *Channel) Join(client *Client) {
channel.members[client] = true
client.channels[channel] = true