forked from External/ergo
fix #384
This commit is contained in:
parent
234d011c29
commit
c6b9fe0218
7 changed files with 224 additions and 243 deletions
|
|
@ -5,13 +5,15 @@ package irc
|
|||
|
||||
import (
|
||||
"github.com/oragono/oragono/irc/isupport"
|
||||
"github.com/oragono/oragono/irc/languages"
|
||||
"github.com/oragono/oragono/irc/modes"
|
||||
)
|
||||
|
||||
func (server *Server) Config() *Config {
|
||||
func (server *Server) Config() (config *Config) {
|
||||
server.configurableStateMutex.RLock()
|
||||
defer server.configurableStateMutex.RUnlock()
|
||||
return server.config
|
||||
config = server.config
|
||||
server.configurableStateMutex.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
func (server *Server) ISupport() *isupport.List {
|
||||
|
|
@ -58,6 +60,10 @@ func (server *Server) GetOperator(name string) (oper *Oper) {
|
|||
return server.config.operators[name]
|
||||
}
|
||||
|
||||
func (server *Server) Languages() (lm *languages.Manager) {
|
||||
return server.Config().languageManager
|
||||
}
|
||||
|
||||
func (client *Client) Nick() string {
|
||||
client.stateMutex.RLock()
|
||||
defer client.stateMutex.RUnlock()
|
||||
|
|
@ -191,6 +197,19 @@ func (client *Client) SetAccountName(account string) (changed bool) {
|
|||
return
|
||||
}
|
||||
|
||||
func (client *Client) Languages() (languages []string) {
|
||||
client.stateMutex.RLock()
|
||||
languages = client.languages
|
||||
client.stateMutex.RUnlock()
|
||||
return languages
|
||||
}
|
||||
|
||||
func (client *Client) SetLanguages(languages []string) {
|
||||
client.stateMutex.Lock()
|
||||
client.languages = languages
|
||||
client.stateMutex.Unlock()
|
||||
}
|
||||
|
||||
func (client *Client) HasMode(mode modes.Mode) bool {
|
||||
// client.flags has its own synch
|
||||
return client.flags.HasMode(mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue