1
0
Fork 0
forked from External/ergo

Merge pull request #247 from slingamn/vhosts.3

initial vhosts implementation, #183
This commit is contained in:
Daniel Oaks 2018-05-19 08:51:16 +10:00 committed by GitHub
commit de7b679fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1069 additions and 375 deletions

View file

@ -83,6 +83,16 @@ func (server *Server) FakelagConfig() *FakelagConfig {
return &server.config.Fakelag
}
func (server *Server) GetOperator(name string) (oper *Oper) {
name, err := CasefoldName(name)
if err != nil {
return
}
server.configurableStateMutex.RLock()
defer server.configurableStateMutex.RUnlock()
return server.operators[name]
}
func (client *Client) Nick() string {
client.stateMutex.RLock()
defer client.stateMutex.RUnlock()
@ -119,6 +129,18 @@ func (client *Client) Realname() string {
return client.realname
}
func (client *Client) Oper() *Oper {
client.stateMutex.RLock()
defer client.stateMutex.RUnlock()
return client.oper
}
func (client *Client) SetOper(oper *Oper) {
client.stateMutex.Lock()
defer client.stateMutex.Unlock()
client.oper = oper
}
func (client *Client) Registered() bool {
client.stateMutex.RLock()
defer client.stateMutex.RUnlock()