add UserCount() helper (along with previous UserExists() helper)
This commit is contained in:
parent
cc15a571a8
commit
861090b0e9
@ -56,6 +56,13 @@ func (this *HubConnection) UserExists(nick string) bool {
|
||||
return already_existed
|
||||
}
|
||||
|
||||
func (this *HubConnection) UserCount() int {
|
||||
this.userLock.RLock()
|
||||
defer this.userLock.RUnlock()
|
||||
|
||||
return len(this.users)
|
||||
}
|
||||
|
||||
func (this *HubConnection) userJoined_NameOnly(nick string) {
|
||||
if !this.UserExists(nick) {
|
||||
this.userLock.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user