mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-29 10:18:11 -07:00
minimal channel mode command
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user