Nick changes get handled properly by the server IRC client, user count stays hidden when the selected tab is not a channel
This commit is contained in:
parent
0a47f2ae4a
commit
e942924c15
5 changed files with 27 additions and 20 deletions
22
irc.go
22
irc.go
|
@ -55,17 +55,18 @@ type Message struct {
|
|||
}
|
||||
|
||||
type IRC struct {
|
||||
conn net.Conn
|
||||
reader *bufio.Reader
|
||||
out chan string
|
||||
ready sync.WaitGroup
|
||||
conn net.Conn
|
||||
reader *bufio.Reader
|
||||
out chan string
|
||||
ready sync.WaitGroup
|
||||
nick string
|
||||
nickLock sync.Mutex
|
||||
|
||||
Messages chan *Message
|
||||
Server string
|
||||
Host string
|
||||
TLS bool
|
||||
TLSConfig *tls.Config
|
||||
nick string
|
||||
Username string
|
||||
Realname string
|
||||
}
|
||||
|
@ -132,6 +133,10 @@ func (i *IRC) Pass(password string) {
|
|||
|
||||
func (i *IRC) Nick(nick string) {
|
||||
i.write("NICK " + nick)
|
||||
|
||||
i.nickLock.Lock()
|
||||
i.nick = nick
|
||||
i.nickLock.Unlock()
|
||||
}
|
||||
|
||||
func (i *IRC) User(username, realname string) {
|
||||
|
@ -170,6 +175,13 @@ func (i *IRC) Quit() {
|
|||
}()
|
||||
}
|
||||
|
||||
func (i *IRC) GetNick() string {
|
||||
i.nickLock.Lock()
|
||||
defer i.nickLock.Unlock()
|
||||
|
||||
return i.nick
|
||||
}
|
||||
|
||||
func (i *IRC) Write(data string) {
|
||||
i.out <- data + "\r\n"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue