implement Client.IsInChannel()
This commit is contained in:
parent
6f29f62e7f
commit
a693871695
10
client.go
10
client.go
@ -12,6 +12,7 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@ -431,6 +432,15 @@ func (c *Client) GetChannels() map[string]*Channel {
|
||||
return c.state.channels
|
||||
}
|
||||
|
||||
// IsInChannel returns true if the client is in channel.
|
||||
func (c *Client) IsInChannel(channel string) bool {
|
||||
c.state.m.RLock()
|
||||
_, inChannel := c.state.channels[strings.ToLower(channel)]
|
||||
c.state.m.RUnlock()
|
||||
|
||||
return inChannel
|
||||
}
|
||||
|
||||
// Who tells the client to update it's channel/user records. Does not update
|
||||
// internal state if tracking is disabled.
|
||||
func (c *Client) Who(target string) error {
|
||||
|
Loading…
Reference in New Issue
Block a user